Getting a list of entities
Use this request to get a list of entities that meet specific criteria.
The request is a unified method for getting a list of projects and portfolios, more flexible and functional than the get project list API.
Request format
Before making a request, get permission to access the API.
To get a list of entities, use an HTTP POST
request. Request parameters are provided in the request body in JSON format.
POST /v2/entities/{entityType}/_search?fields=entityStatus
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID: <organization ID>
{
"filter":
{
"author": "<username>"
}
}
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
Resource
Resource
Parameter | Description | Data type |
---|---|---|
<entity_type> | Entity type:
|
String |
Request parameters
Additional parameters
Parameter | Description | Data type |
---|---|---|
fields | Additional fields to include in the response | String |
perPage | Number of issues per response page. The default value is 50. | Number |
page | Page with search results. The default value is 1. | Number |
Warning
Entity field keys sometimes differ from similar issue keys.
Request body parameters
The request body contains information required to search for entities:
Additional parameters
Parameter | Description | Data type |
---|---|---|
input | Substring in the entity name | String |
filter | Issue filtering parameters. The parameter can specify any field key and value for filtering. | Object |
orderBy | Issue sorting parameters. The parameter can specify any field key for sorting. | String |
orderAsc | Sorting direction | Boolean |
rootOnly | Output only entities that are not nested. | Logical |
Warning
Entity field keys and value keys, e.g., statuses, sometimes differ from similar issue keys.
Example 1: Getting a list of entities using a filter with an extended list of fields in search results
- An HTTP POST method is used.
- The response should only contain projects in progress with a non-empty list of followers.
- The
Status
,Reporter
, andFollowers
field values are displayed in the response.POST /v2/entities/project/_search?fields=entityStatus&author&followers HTTP/1.1 Host: https://api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID: <organization ID> { "filter": { "followers": "notEmpty()", "entityStatus": "in_progress" }, }
Example 2: Getting a sorted list of all entities
- An HTTP POST method is used.
- The response should contain all portfolios sorted by status.
- The results are sorted in descending order.
- The
Status
andReporter
field values are displayed in the response.POST /v2/entities/project/_search?fields=entityStatus&author HTTP/1.1 Host: https://api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID: <organization ID> { "orderBy": "entityStatus", "orderAsc":true }
Example 3: Getting a list of nested projects for the specified portfolio using a filter
- An HTTP POST method is used.
- The response should only contain the nested projects for the parent portfolio with the specified ID.
POST /v2/entities/project/_search HTTP/1.1 Host: https://api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID: <organization ID> { "filter": { "parentEntity": "65868add99a40477********" }, }
Response format
If the request is successful, the API returns a response with code 200 OK
.
The response body contains the results in JSON format.
{
"hits": 8,
"pages": 1,
"values": [
{
"self": "https://https://api.tracker.yandex.net/v2/entities/project/655f8ce5d6a39833********",
"id": "655f8ce5d6a39833********",
"version": 7,
"shortId": 8,
"entityType": "project",
"createdBy": { "self": "https://https://api.tracker.yandex.net/v2/users/11********", "id": "11********", "display": "Full Name", "cloudUid": "ajevuhegoggf********", "passportUid": 11******** },
"createdAt": "2023-11-23T17:33:25.427+0000",
"updatedAt": "2023-11-24T12:21:43.838+0000",
"fields": {
"entityStatus": "in_progress",
"followers": [{ "self": "https://https://api.tracker.yandex.net/v2/users/22********", "id": "22********", "display": "Follower name", "cloudUid": "ajeprm0fjnql********", "passportUid": 22******** }]
}
},
{
"self": "https://https://api.tracker.yandex.net/v2/entities/project/655f3815a834c763********",
"id": "655f3815a834c763********",
"version": 4,
"shortId": 3,
"entityType": "project",
"createdBy": { "self": "https://https://api.tracker.yandex.net/v2/users/11********", "id": "11********", "display": "Full Name", "cloudUid": "ajevuhegoggf********", "passportUid": 11******** },
"createdAt": "2023-11-23T11:31:33.874+0000",
"updatedAt": "2023-11-23T21:52:10.863+0000",
"fields": {
"entityStatus": "draft",
"followers": [{ "self": "https://https://api.tracker.yandex.net/v2/users/22********", "id": "22********", "display": "Follower name", "cloudUid": "ajeprm0fjnql********", "passportUid": 22******** }]
}
}
],
"orderBy": "entityStatus"
}
Response parameters
Parameter | Description | Data type |
---|---|---|
hits | Number of search results | Number |
pages | Number of pages with search results | Number |
values | Results Entity objects | Array of objects |
Entity object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the project | String |
id | Entity ID | String |
version | Entity version. Each change of the parameters increases the version number. | Number |
shortId | Project or portfolio ID | String |
entityType | Entity type | String |
createdBy | Block with information about the entity creator | Object |
createdAt | Entity creation date in YYYY-MM-DDThh:mm:ss.sss±hhmm format |
String |
updatedAt | Date when the entity was last updated, in YYYY-MM-DDThh:mm:ss.sss±hhmm format |
String |
fields | Object with additional fields | Object |
createdBy
object fields
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the entity creator | String |
id | User ID | Number |
display | Displayed user name | String |
cloudUid | Unique user ID in Yandex Cloud Organization | String |
passportUid | Unique ID of the user account in the Yandex 360 for Business organization and Yandex ID | String |
If the request is processed incorrectly, the API returns a response with an error code:
- 400
- One or more request parameters have an invalid value.
- 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.