Retrieve a List of Locations for an Account

This example shows you how to retrieve all the locations associated with an account.

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

Write the code

Add the following to get-locations.sh:

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

View full source

Run your code

Save this file to your machine and run it:

bash get-locations.sh
The response is a JSON object containing an array of location objects. See the API documentation for descriptions of the fields in the response.
{
   "_links":{
      "self":{
         "href":".../accounts/9999999/locations"
      }
   },
   "_embedded":{
      "locations":[
         {
            "id":1111111,
            "name":"Test Location",
            "address":{
               "address_1":"23 MAIN ST",
               "address_2":null,
               "country":"US",
               "state":"NJ",
               "city":"holmdel",
               "postal_code":"07733",
               "time_zone":"America/New York"
            }
         }
      ]
   }
}