Importing files

Use this request to import files attached to an issue and its comments into Tracker.

POST

https://api.tracker.yandex.net/v3/issues/<issue_ID>/attachments/_import?filename=<filename>&createdAt=<createdAt>&createdBy=<createdBy>

Before executing the request, make sure the user has permission to edit the issue to which the files are attached.

Query format

To import a file, use an HTTP POST request. Provide the file in the request body using multipart/form-dataRFC-7578. The file size may not exceed 1024 Mbit.

POST /v3/issues/<issue_ID>/attachments/_import?filename=<filename>&createdAt=<createdAt>&createdBy=<createdBy>
Host: api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID or X-Cloud-Org-ID: <organization_ID>
Content-Type: multipart/form-data
<file>
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-ID or X-Cloud-Org-ID: Organization ID.

    • Use the X-Org-ID header if a Tracker organization is linked to Yandex 360 for Business.

    • Use the X-Cloud-Org-ID header if a Tracker organization is linked to Yandex Cloud Organization.

    To get the organization ID, go to AdministrationOrganizations and copy the value from the ID field.

  • Content-Type

    Request body format. The required value is multipart/form-data.

Resource
Parameter Description Data type
<issue_ID> Key of the issue to attach the file to. String
<comment_ID> ID of the comment to attach the file to. String
Request parameters

Required parameters

Parameter Description Data type
filename File name, no more than 255 characters. String
createdAt Date and time when the file is attached, in YYYY-MM-DDThh:mm:ss.sss±hhmm format. You can specify any value in the interval from the issue's creation time to its latest update. String
createdBy Username or ID of the user who attached the file. String
Request body parameters

Required parameters

Parameter Description Data type
file_data Uploaded file. The file size may not exceed 1024 Mbit. String
POST /v3/issues/<issue_ID>/comments/<comment_ID>/attachments/_import?filename={filename}&createdAt={createdAt}&createdBy={createdBy}
Host: api.tracker.yandex.net
Authorization: OAuth <OAuth_token>
X-Org-ID or X-Cloud-Org-ID: <organization_ID>
Content-Type: multipart/form-data
<file>
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-ID or X-Cloud-Org-ID: Organization ID.

    • Use the X-Org-ID header if a Tracker organization is linked to Yandex 360 for Business.

    • Use the X-Cloud-Org-ID header if a Tracker organization is linked to Yandex Cloud Organization.

    To get the organization ID, go to AdministrationOrganizations and copy the value from the ID field.

  • Content-Type

    Request body format. The required value is multipart/form-data.

Resource
Parameter Description Data type
<issue_ID> Key of the issue to attach the file to. String
<comment_ID> ID of the comment to attach the file to. String
Request parameters

Required parameters

Parameter Description Data type
filename File name, no more than 255 characters. String
createdAt Date and time when the file is attached, in YYYY-MM-DDThh:mm:ss.sss±hhmm format. You can specify any value in the interval from the issue's creation time to its latest update. String
createdBy Username or ID of the user who attached the file. String
Request body parameters

Required parameters

Parameter Description Data type
<file> Uploaded file. The file size may not exceed 1024 Mbit. String

Response format

If the request is successful, the API returns a response with code 200 OK.

The response body contains the parameters of the attached file in JSON format:

{
  "self": "https://api.tracker.yandex.net/v3/issues/JUNE-2/attachments/123",
  "id" : "123",
  "name" : "pic.png",
  "content" : "api.tracker.yandex.net/v3/issues/JUNE-2/attachments/123/pic.png",
  "thumbnail" : "api.tracker.yandex.net/v3/issues/JUNE-2/thumbnails/123",
  "createdBy" : {
	"self": "https://api.tracker.yandex.net/v3/users/12********",
	"id" : "12********",
	"display" : "<displayed_employee_name>"
  },
  "createdAt" : "2017-06-11T05:16:01.339+0000",
  "mimetype" : "image/png",
  "size" : 5678
  "metadata" : {
	"size" : "128x128"
  }
}
Response parameters
Parameter Description Data type
self Address of the API resource corresponding to the attached file String
id File's unique ID. String
name File name String
content Address of the resource to download the file from String
thumbnail Address of the resource to download the preview thumbnail from; available for image files only String
createdBy Object with information about the user who attached the file JSON object
createdAt Date and time when the file is uploaded, in
YYYY-MM-DDThh:mm:ss.sss±hhmm format
String
mimetype File type, for example:
  • text/plain: Text file
  • image/png: Image in PNG format
String
size File size in bytes Integer
metadata Object with file metadata JSON object

createdBy object fields

Parameter Description Data type
self Address of the resource corresponding to the user who uploaded the file. String
id User's login. String
display User's name (as in the interface). String

metadata object fields

Parameter Description Data type
size Image size in pixels String

If the request is processed incorrectly, the API returns a message with error details:

400
One or more request parameters have an invalid value.
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.
404
The requested object was not found. You may have specified an invalid object ID or key.
413
The file size exceeds 1024 Mb.
422
JSON validation error, the request is rejected.
500
Internal service error. Try again later.
503
The API service is temporarily unavailable.