cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning Phone Numbers via API

MattS_Lab
Listener

I am trying to test the process for assigning phone numbers to users via API, but I am not having success. When I try using postman "200 OK" response with nothing in the body. 

 

Attached are screen shots of what I am sending. Anyone able to spot what I am doing wrong or can send an example of a successful post?

 

Note: other API calls are working as expected. 

 

1 ACCEPTED SOLUTION

Craig
Community Champion | Zoom Employee
Community Champion | Zoom Employee

Hello Matt,

 

There are a couple of things to slightly modify.

 

1. First you should use an email address for the User ID in the URL endpoint, for example:

https://api.zoom.us/v2/phone/users/<emailaddress>/phone_numbers

This may, in itself, resolve the problem for you. If not....

 

2. In addition to point 1, create a new request, but create a raw JSON body as follows

{
"phone_numbers": [
{
"id": "<phone number ID here",
"number": "e164 phone number here"
}
]
}
 
Note that the ID field in the JSON body is the ID of the phone number. You can get this from a GET request to https://api.zoom.us/v2/phone/numbers
 
I would suggest you start here, and let us know how you get on.

View solution in original post

3 REPLIES 3

Craig
Community Champion | Zoom Employee
Community Champion | Zoom Employee

Hello Matt,

 

There are a couple of things to slightly modify.

 

1. First you should use an email address for the User ID in the URL endpoint, for example:

https://api.zoom.us/v2/phone/users/<emailaddress>/phone_numbers

This may, in itself, resolve the problem for you. If not....

 

2. In addition to point 1, create a new request, but create a raw JSON body as follows

{
"phone_numbers": [
{
"id": "<phone number ID here",
"number": "e164 phone number here"
}
]
}
 
Note that the ID field in the JSON body is the ID of the phone number. You can get this from a GET request to https://api.zoom.us/v2/phone/numbers
 
I would suggest you start here, and let us know how you get on.

Craig
Community Champion | Zoom Employee
Community Champion | Zoom Employee

Further to my previous message, attached is an example from postman with a correctly formatted URL and JSON body. Of course, you'll need to make sure you have the appropriate authorisation in place (JWT, OAuth etc.). 

MattS_Lab
Listener

Thanks - that worked by using the JSON rather than the fields in the pre-configured post command. I also noticed that I needed to uncheck the header field for "Content-Type - multipart/form-data" in postman. see attached.