Join us in San Francisco on the 29/30th of October for two days of developer workshops and technical talks

Retrieve a List of Extensions

This example shows you how to use the Extension API to retrieve a list of extensions associated with an account.

Replace the following placeholders in the example with your own details:

Write the code

Add the following to get-extensions.sh:

Copy to Clipboard
curl -H "Authorization: Bearer $VBC_TOKEN" \
  https://api.vonage.com/t/vbc.prod/provisioning/api/accounts/$VBC_ACCOUNT_ID/extensions

View full source

Run your code

Save this file to your machine and run it:

bash get-extensions.sh

The response is a JSON object containing an array of extension objects. See the API documentation for descriptions of the fields in the response.

{
   "page_size":100,
   "page":1,
   "total_pages":1,
   "total_items":51,
   "_links":{
      "first":{
         "href":".../accounts/9999999/extensions?page_size=100&page=1"
      },
      "self":{
         "href":".../accounts/9999999/extensions?page_size=100&page=1"
      },
      "last":{
         "href":".../accounts/9999999/extensions?page_size=100&page=1"
      }
   },
   "_embedded":{
      "extensions":[
         {
            "extension_number":"2222",
            "location_id":1111111,
            "vtt_enabled":false,
            "dnd_enabled":false,
            "caller_id":"14155550100",
            "block_caller_id":false,
            "dids":[

            ],
            "extension_handsets":[
               {
                  "handset_name":"line1-ABC123",
                  "sip_id":"ABC123"
               }
            ]
         },
         {
           ...
         }
      ]
   }
}