Retrieve a User's Details

This example shows you how to use the User API to retrieve details about a specific user 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 extension is associated with
  • VBC_USER_ID - the ID of the user you want to retrieve details for

Write the code

Add the following to get-user.sh:

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

View full source

Run your code

Save this file to your machine and run it:

bash get-user.sh

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

{
   "_links":{
      "self":{
         "href":".../accounts/9999999/users/7777777"
      }
   },
   "_embedded":{
      "user":{
         "email":"bob.smith@example.com",
         "login_name":"bob.smith",
         "first_name":"Robert",
         "last_name":"Smith",
         "id":7777777,
         "contact_numbers":[
            {
               "type":"Mobile",
               "value":"447700900000"
            },
            {
               "type":"Home",
               "value":"442079460000"
            },
            {
               "type":"Fax",
               "value":"442079460005"
            }
         ],
         "extensions":[

         ]
      }
   }
}