Users


The following fields relate to the Users endpoint.

FieldLimitsRequired?Writeable?
id
NoNo

The id of the user

first_name
255 characters
NoNo
last_name
255 characters
NoNo
email
255 characters
NoNo
username
255 characters
NoNo
phone
NoNo
system_phone
NoNo

System-specific phone number used to send text messages

timezone_offset
Only accepts integers
NoNo

Time offset from Greenwich Mean Time

timezone
200 characters
NoNo
profile_picture
NoNo

The profile picture url

created_at
NoNo

The date and time at which the user signed up

modified_at
NoNo

The date and time at which the user was last updated

Filtering users

You may find/search one or all users with an unexpired OAuth access token to your application by specifying an oauth_client_id parameter in the request URI

Only active users (is_active: 1) will be retrieved.

Requests to a user that does not have a valid OAuth access token to your application will result in a 401 error.

Requests to an oauth_client_id that does not belong to the querying user will result in a 401 error.

Requests to an oauth_client_id that does not exist will result in a 403 error.

Filtering one application user

To get one user:

GET https://api-v2.liondesk.com//users/10?oauth_client_id=liondesk headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The response object will have this form:{ "id": 10, "first_name": "Grace", "last_name": "Hopper", "email": "grace@example.com", "username": "gracehopper1", "phone": "6042345678", "system_phone": "2159494949", "timezone_offset": "-8", "timezone": "America/Los_Angeles", "profile_picture": "www.example.com/4354353/example-img.jpeg", "created_at": "2014-03-09T13:55:30.000Z" }

Filtering all application users

You find/search users by issuing a GET request to the base endpoint:

GET https://api-v2.liondesk.com//users?oauth_client_id=liondesk headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The response will contain an array of user objects, like so:

{ "total": 2, "limit": 10, "skip": 0, "data": [ { "id": 10, "first_name": "Grace", "last_name": "Hopper", "email": "grace@example.com", "username": "gracehopper1", "phone": "6042345678", "system_phone": "2159494949", "timezone_offset": "-8", "timezone": "America/Los_Angeles", "profile_picture": "www.example.com/4354353/example-img.jpeg", "created_at": "2014-03-09T13:55:30.000Z" }, { "id": 34, "first_name": "Ada", "last_name": "Lovelace", "email": "ada@example.com", "username": "ada2", "phone": "7782295949", "system_phone": "6135025839", "timezone_offset": "+8", "timezone": "Australia/Perth", "profile_picture": "www.example.com/4545522/example-img.jpeg", "created_at": "2018-04-17T09:20:23.000Z" } ] }

Default Behavior

If an oauth_client_id is not provided in the endpoint, the default behavior for both finding users and getting a user returns the user currently making the query.

Get one user

Requests to an unauthorized user will result in a 403 error.

Requests to an inactive user (is_active: 0) will result in a 404 error.

GET https://api-v2.liondesk.com//users/10 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

Find all users

GET https://api-v2.liondesk.com//users headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }