Linking entities
The request allows you to create links between multiple entities.
Request format
Before making a request, get permission to access the API.
To create links, use an HTTP POST
request. Information about the links is transmitted in its body in JSON format. The link is created between the current entity (specified in the request <entity_ID>
) and the entities whose IDs are specified in the entity
fields of the request body.
POST /v2/entities/<entity_type>/<entity_ID>/links
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID: <organization ID>
{
"relationship": "<link_type>",
"entity": "<linked_entity_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
Resource
Parameter | Description | Data type |
---|---|---|
<entity_type> | Entity type:
|
String |
<entity_ID> | Entity ID. To get the ID, see the entity list. | String |
<project_or_portfolio_ID> | Project or portfolio ID (the shortId value). You can use it instead of the entity ID in the request. |
String |
Warning
Entity ID is not the same as project or portfolio ID.
Request body parameters
Required parameters
Parameter | Description | Data type |
---|---|---|
relationship | Link type:
|
String |
entity | ID of the entity you are establishing a link with. Instead, you can use the project or portfolio ID (the shortId field value) in the request. |
String |
Example: Creating a link between entities
- An HTTP POST method is used.
POST /v2/entities/project/<project_ID>/links Host: https://api.tracker.yandex.net Authorization: OAuth <OAuth_token> X-Org-ID: <organization ID> [ { "relationship":"is dependent by", "entity": "6582874de6db7f5f********" }, { "relationship":"relates", "entity": "65868f3fe2b9ef74********" } ]
Response format
If the request is successful, the API returns a response with code 200 OK
.
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.
- 404
- The requested object was not found. You may have specified an invalid object ID or key.
- 422
- JSON validation error, the request is rejected.