Getting user information with relative pagination
The request lets you get information about user accounts registered in the organization using relative pagination. Unlike the standard method for getting users, this request lets you retrieve more than 10,000 records.
GET
https://api.tracker.yandex.net/v3/users/_relative?expand=groups
Request format
Before you send the request, get access to the API.
To get information about users in the organization, use an HTTP request with the GET method:
GET /v3/users/_relative?perPage=<number_of_elements>&id=<identifier>&expand=<additional_fields>
Host: api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID or X-Cloud-Org-ID: <organization_ID>
Headers
-
Host: address of the node that provides the API. -
Authorization: Authorization token about these formats:-
OAuth <OAuth_token>: For authorization using the OAuth 2.0 protocol. Learn more -
Bearer <IAM_token>: For authorization using an IAM token, if a Yandex Cloud Organization organization is linked to Tracker. Learn more
-
-
X-Org-IDorX-Cloud-Org-ID: Organization ID.-
Use the
X-Org-IDheader if a Tracker organization is linked to Yandex 360 for Business. -
Use the
X-Cloud-Org-IDheader if a Tracker organization is linked to Yandex Cloud Organization.
To get the organization ID, go to Administration → Organizations and copy the value from the ID field.
-
Request parameters
Additional parameters
| Parameter | Description | Data type |
|---|---|---|
| perPage | Number of items per page. From 1 to 100 inclusive. | Number |
| id | The user ID (uid) to start searching from. | Number |
| expand | Additional information to include in the response:
|
String |
Example: Request information about users, including their group memberships.
GET /v3/users/_relative?expand=groups Host: api.tracker.yandex.net Authorization: OAuth y0__xAbc****** X-Org-ID: 1234******
Response format
If the request is successful, the API returns a response with code 200 OK.
The response body contains a JSON object with an array of users and information about whether there are more pages.
{
"users": [
{
"self": "https://api.tracker.yandex.net/v3/users/12********",
"uid": 12********,
"login": "username",
"trackerUid": 12********,
"passportUid": 12********,
"cloudUid": "bfbdrb1aa248********",
"firstName": "John",
"lastName": "Smith",
"display": "John Smith",
"email": "username@example.com",
"groups": [
{
"self": "https://api.tracker.yandex.net/v3/groups/5",
"id": "5",
"display": "Developers"
}
],
"external": false,
"hasLicense": true,
"dismissed": false,
"useNewFilters": true,
"disableNotifications": false,
"firstLoginDate": "2019-08-22T14:56:57.981+0000",
"lastLoginDate": "2022-06-22T17:44:32.981+0000",
"welcomeMailSent": true,
"sources": [
"directory"
]
},
...
],
"hasNext": true
}
Response parameters
General parameters
| Parameter | Description | Data type |
|---|---|---|
| users | Array of objects with user information. | Array of objects |
| hasNext | Indicates if there are more pages:
|
Boolean |
Parameters of the user object
| Parameter | Description | Data type |
|---|---|---|
| self | Address of the API resource containing the user account information. | String |
| uid | Unique identifier of the user account in Tracker. | Number |
| login | User login. | String |
| trackerUid | Unique identifier of the user account in Tracker. | Number |
| passportUid | Unique identifier of the user account in the Yandex 360 for Business organization and Yandex ID. | Number |
| cloudUid | Unique identifier of the user in Yandex Cloud Organization. | String |
| firstName | User's first name. | String |
| lastName | User's last name. | String |
| display | User's display name. | String |
| User's email address. | String | |
| groups | Groups the user belongs to. Included in the response if the expand parameter in the request is set to groups. |
Array of objects |
| external | System parameter. | Boolean |
| hasLicense | Indicates if the user has full access to Tracker:
|
Boolean |
| dismissed | User status in the organization:
|
Boolean |
| useNewFilters | System parameter. | Boolean |
| disableNotifications | Indicates if notifications are forcibly disabled for the user:
|
Boolean |
| firstLoginDate | Date and time of the user's first login to Tracker. Format: YYYY-MM-DDThh:mm:ss.sss±hhmm. |
String |
| lastLoginDate | Date and time of the user's last login to Tracker. Format: YYYY-MM-DDThh:mm:ss.sss±hhmm. |
String |
| welcomeMailSent | How the user was added:
|
Boolean |
| sources | Data source (for example, corporate directory). | String |
| position | Job title. | String |
Parameters of objects in the groups array
| Parameter | Description | Data type |
|---|---|---|
| self | Address of the API resource containing group information. | String |
| id | Group ID. | String |
| display | Group display name. | String |
- 401
- The user is not authorized. Make sure that actions described in the API access section are performed.
- 403
- You are not authorized to perform this action. You can check what rights you have in the Tracker interface. The same rights are required to perform an action via the API and interface.
Pagination mechanism
The request uses relative pagination:
- Users in the response are sorted in ascending order by user uid.
- To get the next page, specify the uid of the last user from the previous response page as the
idparameter. - The
hasNextfield in the response indicates whether there are more pages to load.
Example of sequential requests
-
First request:
GET /v3/users/_relative?perPage=50 -
Next request (if
hasNext: true):GET /v3/users/_relative?perPage=50&id=<last_user_uid>