Add an external link
Written by
Use this request to create a link for working with an external application object.
Request format
Before making the request, get permission to access the API.
To create an external link, use an HTTP POST
request.
POST /v2/issues/<issue-id>/remotelinks?backlink=true
Host: https://api.tracker.yandex.net
Authorization: OAuth <OAuth token>
X-Org-ID: <organization ID>
{
"relationship": "RELATES",
"key": "<object key>",
"origin": "<application ID>"
}
Headers
-
Host
API host address:
https://api.tracker.yandex.net
-
Authorization
OAuth token in
OAuth <token value>
format. For example:OAuth 0c4181a7c2cf4521964a72ff57a34a07
-
X-Org-ID
Organization ID.
Resource
Parameter | Description | Data type |
---|---|---|
<issue-id> | ID or key of the current issue. | String |
Request parameters
Additional parameters
Parameter | Description | Data type |
---|---|---|
backlink | Set true to execute a request from Tracker, when adding a link, to create a duplicate link in an external application. |
Boolean |
Request body parameters
Required parameters
Parameter | Description | Data type |
---|---|---|
relationship | Link type. We recommend using the value RELATES . |
String |
key | Key of the external application object. | String |
origin | ID of the application whose object you need to create a link to. | String |
Response format
Request executed successfully
Request failed
If the request is successful, the API returns a response with code 201 Created
.
The request body contains information about the created link in JSON format.
{
"self": "https://api.tracker.yandex.net/v2/issues/<issue-id>/remotelinks/51455195",
"id": 51455195,
"type": {
"self": "https://api.tracker.yandex.net/v2/linktypes/relates",
"id": "relates",
"inward": "Linked",
"outward": "Linked"
},
"direction": "outward",
"object": {
"self": "https://api.tracker.yandex.net/v2/applications/ru.yandex.bitbucket/objects/<object-id>",
"id": "<object-id>",
"key": "<object-key>",
"application": {
"self": "https://api.tracker.yandex.net/v2/applications/<application-id>",
"id": "<application-id>",
"type": "<application-type>",
"name": "<application-name>"
}
},
"createdBy": {
"self": "https://api.tracker.yandex.net/v2/users/1120000000232694",
"id": "user-name",
"display": "display-user-name"
},
"updatedBy": {
"self": "https://api.tracker.yandex.net/v2/users/1120000000232694",
"id": "user-name",
"display": "display-user-name"
},
"createdAt": "2021-07-19T06:18:09.327+0000",
"updatedAt": "2021-07-19T06:18:09.327+0000"
}
Response parameters
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the external link. | String |
id | Link ID. | String |
type | Block with information about the link type. | Object |
direction | Linkdirection. The parameter is relevant for non-symmetric link types, such as Parent issue— Sub-issue. Possible values:
|
String |
object | Block with information about an external application object. | Object |
createdBy | Block with information about the user who created the link. | Object |
updatedBy | Block with information about the employee who updated the link last. | Object |
createdAt | Link creation date and time. | String |
updatedAt | Date and time when the link was last updated. | String |
Object fields type
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the link type. | String |
id | ID of the link type. | String |
inward | Link type name depending on the direction. |
String |
outward | Link type name depending on the direction. |
String |
Object fields object
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the external application object. | String |
id | Object ID. | String |
key | Object key. | String |
application | Block with information about the external application. | Object |
Object fields application
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the external application. | String |
id | Application ID. | String |
type | Application type. | String |
name | Application name displayed. | String |
Object fields createdBy
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the user. | String |
id | User ID. | String |
display | User's name displayed. | String |
Object fields updatedBy
Parameter | Description | Data type |
---|---|---|
self | Address of the API resource with information about the user. | String |
id | User ID. | String |
display | User's name displayed. | 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.