Skip to main content
Explorer
Jan 15, 2022 7:42 PM UTC
Solved

Assigning Phone Numbers via API

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. 

 

    Craig
    CraigAnswer
    Employee
    Jan 17, 2022 4:28 PM UTC

    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.

    3 replies

    Craig
    Employee
    CraigAnswer
    Employee
    Jan 17, 2022 4:28 PM UTC

    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.
    Translate
    Craig
    Employee
    Employee
    Jan 17, 2022 4:35 PM UTC

    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.). 

    Translate
    MattS_LabAuthor
    Explorer
    Jan 18, 2022 8:33 PM UTC

    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. 

    Translate