Filtering and sorting users by fields and subresources
This is part of the API Basics section of the Web Services API.
Overview
This section provides additional details on the filtering functionality described in Pagination and Subresources.
The request accepts comma-delimited list of fields as a sortBy parameter.
This allows an API user to specify multiple sorting fields so that sorting is done by the first field specified, then by the second field specified, and so on.
Example
Here is the sample request which returns users sorted by voice channel state and inside users with same state sorted by lastName.
GET ...api/v2/users?subresources=statistics&limit=100&sortBy=statistics.channels.voice.state,lastName
The list of user properties which can be used for filtering:
- firstName
- lastName
- userName
- enabled
- roles
The list of subresources fields what can be used for filtering:
Subresource | Description |
---|---|
devices.phoneNumber | Search for user which has assigned device with provided phone number. Please note that server stores for search purposes phone numbers in fixed format which contains digits only, thus value should not contain any non-digits. |
skills.name | Search for user(s) which have an assigned skill with the name provided. |
skills.level | Search for users(s) which have assigned skills with provided skillLevel. |
statistics.channels.voice.state | Search for users with specified voice channel states.
|
statistics.channels.voice.displayNameSearch | for users with specified voice channel display names.
|
statistics.channels.voice.activity | Search for users with specified voice channel activites.
|
statistics.channels.voice.workMode | Search for users with specified voice channel workModes.
|
Here is the list of available sort fields:
- userName
- firstName
- lastName
- enabled
- roles
- devices.phoneNumber
- skills.name
- skills.level
- statistics.channels.voice.state
- statistics.channels.voice.activity
- statistics.channels.voice.displayName
- statistics.channels.voice.workMode
- statistics.<statisticName>.value
The statistics.<statisticName>.value is the value of simple statistic with name <statisticName> as defined in statistics.yaml.