Users

Retrieving users

Users can be retrieved easily with a GET request to the /users endpoint. A simple /users will result in all users being retrieved with all their basic identity information. The result is limited to users with a status of ACTIVE. Users with other statuses are not listed in the results.

Once the request is placed, the response is a list of URLs to each of the users that the API user has access to or has requested via the search criteria.

Note: The sample request here shows users from the company that the existing API user is associated with. You can't retrieve user lists from outside your company and users with the status != ACTIVE.

Get a specific user

To get details of a specific user, the URI must be passed with the ID of the user. So, the URI is:

https://api.<region>.whispir.com/users/AF48A9EC3F02E43C

where AF48A9EC3F02E43C is the user id.

Retrieving workspace users

To retrieve the list of users, you make a GET request to /workspaces/{:id}/users endpoint.

By default a maximum of 20 users is returned in a request.

You can use the limit and offset query parameters to determine how many users you want to receive. (The default is limit=20 & offset=0.)

  • JSON
  • XML

Retrieving a list of users

Users can easily be retrieved from the Whispir API using the following endpoints:

 

{{codeStart}}

HTTP 1.1 GET https://api.<region>.whispir.com/users?apikey=<your_api_key>

Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk

x-api-key: your_api_key

Accept: application/vnd.whispir.user-v1+json

{

"status": "1 to 1 of 1",

"Users": [

{

"id": "AF48A9EC3F02E43C",

"firstName": "Fred",

"lastName": "Smith",

"companyName": "Whispir Pte Ltd",

"workEmailAddress1": "fsmith@testcompany.com",

"workMobilePhone1": "61423456789",

"link": {

"method": "GET",

"rel": "self",

"uri": "http://api.<region>.whispir.com/users/AF48A9EC3F02E43C?apikey=<your_api_key>"

}

},

...

]

}

{{codeEnd}}

 

Retrieving a specific user

Users can retrieve a specific user by supplying the user ID in the URL:

 

{{codeStart}}

HTTP 1.1 GET https://api.<region>.whispir.com/users/AF48A9EC3F02E43C?apikey=<your_api_key>

Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk

x-api-key: your_api_key

Accept: application/vnd.whispir.user-v1+json

{

"id": "AF48A9EC3F02E43C",

"firstName": "Fred",

"lastName": "Smith",

"status": "ACTIVE",

... remainder of the user object

"link": {

"method": "GET",

"rel": "self",

"uri": "http://api.<region>.whispir.com/users/AF48A9EC3F02E43C?apikey=<your_api_key>"

}

}

{{codeEnd}}


Retrieving list of users having access to a workspace

 

{{codeStart}}

HTTP 1.1 GET https://api.<region>.whispir.com/workspaces/C727BCE3A813E2B1/users/?apiKey=<your_api_key>

Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk

x-api-key: your_api_key

Accept: application/vnd.whispir.user-v1+json

{

"users": [

{

"id": "AF48A9EC3F02E43C",

"firstName": "Fred",

"lastName": "Smith",

"companyName": "Whispir Pte Ltd",

"workEmailAddress1": "fsmith@whispir.com",

"workMobilePhone1": "6512348765",

"link": [

{

"uri": "https://api.<region>.whispir.com/workspaces/C727BCE3A813E2B1/users/AF48A9EC3F02E43C?apikey=<your_api_key>",

"rel": "self",

"method": "GET"

}

]

},

{

"id": "DFC878BCB2EF9258",

"firstName": "John",

"lastName": "Wick",

"companyName": "",

"workEmailAddress1": "jwick@whispir.com",

"link": [

{

"uri": "https://api.<region>.whispir.com/workspaces/C727BCE3A813E2B1/users/DFC878BCB2EF9258?apikey=<your_api_key>",

"rel": "self",

"method": "GET"

}

]

},

...

"status": "1 to 20 of 28",

"link": [

{

"uri": "https://api.<region>.whispir.com/workspaces/C727BCE3A813E2B1/users/?apikey=<your_api_key>&offset=10&limit=10",

"rel": "next",

"method": "GET"

}

]

}

{{codeEnd}}