Retrieve Details of an Account Location

This example shows you how to use the Account API to retrieve details about a specific location associated with an account.

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

  • VBC_TOKEN - a valid token (see authentication)
  • VBC_ACCOUNT_ID - the account number the location is associated with
  • VBC_LOCATION_ID - the location ID you want to retrieve details for

Write the code

Add the following to get-location.sh:

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

View full source

Run your code

Save this file to your machine and run it:

bash get-location.sh

The response is a JSON object containing details about the location. See the API documentation for descriptions of the fields in the response.

{
   "_links":{
      "self":{
         "href":".../accounts/9999999/locations/1111111"
      }
   },
   "_embedded":{
      "location":{
         "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"
         }
      }
   }
}