Assigning Phone Numbers via API | Community
Skip to main content
Newcomer
January 15, 2022
Solved

Assigning Phone Numbers via API

  • January 15, 2022
  • 3 replies
  • 9 views

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. 

 

    Best answer by Craig

    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
    January 17, 2022

    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
    Employee
    Employee
    January 17, 2022

    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_LabAuthor
    Newcomer
    January 18, 2022

    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.