Retrieve a List of Users

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

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

Write the code

Add the following to get-users.sh:

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

View full source

Run your code

Save this file to your machine and run it:

bash get-users.sh

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

{
   "page_size":100,
   "page":1,
   "total_pages":1,
   "total_items":47,
   "_links":{
      "first":{
         "href":".../accounts/9999999/users?page_size=100&page=1"
      },
      "self":{
         "href":".../accounts/9999999/users?page_size=100&page=1"
      },
      "last":{
         "href":".../accounts/9999999/users?page_size=100&page=1"
      }
   },
   "_embedded":{
      "users":[
         {
            "email":"alice.jones@example.com",
            "login_name":"alice.jones",
            "first_name":"Alice",
            "last_name":"Jones",
            "id":8888888,
            "contact_numbers":[
               {
                  "type":"Mobile",
                  "value":"447700900001"
               },
               {
                  "type":"Home",
                  "value":"442079460003"
               },
               {
                  "type":"Fax",
                  "value":null
               }
            ],
            "extensions":[
               {
                  "dids":[
                     "447700900002"
                  ],
                  "extension_number":"333"
               }
            ]
         },
         {
          ...
         }
      ]
   }
}