Getting information about the current user
Use this request to get information about the account of the user on whose behalf the API is being accessed.
Request format
Before making the request, get permission to access the API.
To get information about the current user, use an HTTP GET
request:
GET /v2/myself
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth token>
X-Org-ID: <organization ID>
Headers
-
Host
Address of the node that provides the API:
https://api.tracker.yandex.net
-
Authorization
OAuth token in
OAuth <OAuth_token>
format, e.g.:OAuth 0c4181a7c2cf4521964a72ff********
-
X-Org-ID or X-Cloud-Org-ID
Organization ID. You can find it out on the Tracker organizations page
.- If a Yandex 360 for Business organization is the only one linked to Tracker, the
X-Org-ID
header is used. - If a Yandex Cloud Organization organization is the only one linked to Tracker, the
X-Cloud-Org-ID
header is used. - If both Yandex 360 for Business and Yandex Cloud Organization organizations are linked to Tracker at the same time, the
X-Org-ID
header and the Yandex 360 for Business organization ID are used.
- If a Yandex 360 for Business organization is the only one linked to Tracker, the
For example, using curl
:
curl --request GET "https://api.tracker.yandex.net/v2/myself" \
--header "Authorization: OAuth <OAuth_token>" \
--header "X-Cloud-Org-Id: <organization_ID>"
Response format
If the request is successful, the API returns a response with code 200 OK
.
The response body contains a JSON array with the current user parameters.
[
{
"self": "https://https://api.tracker.yandex.net/v2/users/12********",
"uid": 12********,
"login": "<user_login>",
"trackerUid": 12********,
"passportUid": 12********,
"cloudUid": "bfbdrb1aa248********",
"firstName": "<first_name>",
"lastName": "<last_name>",
"display": "<displayed_name>",
"email": "<email>",
"external": false,
"hasLicense": true,
"dismissed": false,
"useNewFilters": true,
"disableNotifications": false,
"firstLoginDate": "2020-10-27T13:06:21.787+0000",
"lastLoginDate": "2022-07-25T17:12:33.787+0000",
"welcomeMailSent": true
}
]
Response parameters
Warning
Starting October 1, 2023, the default user ID type changed from passportUid
to uid
. Therefore, we recommend that you explicitly specify user ID type when performing integration.
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the user account. | String |
uid | Unique ID of the user Tracker account. | Number |
login | User's login. | String |
trackerUid | Unique ID of the user Tracker account. | Number |
passportUid | Unique ID of the user account in the Yandex 360 for Business organization and Yandex ID. | Number |
cloudUid | User unique ID in Yandex Cloud Organization. | String |
firstName | Username. | String |
lastName | User's last name. | String |
display | Displayed user name. | String |
User email address. | String | |
external | Service parameter | Logical |
hasLicense | Flag indicating whether the user has full access to Tracker:
|
Logical |
dismissed | User status in the organization:
|
Logical |
useNewFilters | Service parameter | Logical |
disableNotifications | Flag indicating whether user notifications are forced disabled:
|
Logical |
firstLoginDate | Date and time of the user's first authentication, in the YYYY-MM-DDThh:mm:ss.sss±hhmm format. |
String |
lastLoginDate | Date and time of the user's last authentication, in the YYYY-MM-DDThh:mm:ss.sss±hhmm format. |
String |
welcomeMailSent | Method of adding a user:
|
Logical |
- 401
- The user isn't authorized. Make sure to perform the actions described in API access.
- 403
- Insufficient rights 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.
- 404
- The requested object was not found. You may have specified an invalid object ID or key.