Get the list of files

Attention

The toloka.yandex.com domain will be disabled starting April 1, 2023. Please use the toloka.dev domain for API requests.

Gets the list of files saved in Toloka.

Warning

Files are downloaded not in the order in which they were uploaded to the server.

Request

Production version
Sandbox
GET https://toloka.dev/api/v1/attachments
Authorization: OAuth <OAuth token>

Headers

TitleOverview
AuthorizationA token for account authorization. Add OAuth as a prefix.

Query parameters

Query parameters are specified in the link after the question mark and separated by &.

ParameterOverview
pool_idstring

Pool ID.
assignment_idstring

ID of the task suite assignment.
namestring

File name.
typestring

Attachment type. Currently the key can have only one value — ASSIGNMENT_ATTACHMENT.
user_idstring

ID of the Toloker who uploaded the file(s).
sort

string

Parameters to sort by:

  • id — The file identifier.
  • created — The date when the file was uploaded, in UTC using ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

    To learn how to configure sorting, see Sorting the list of objects.
Standard query parameterslimit, id_gt, id_gte, id_lt, id_lte, created_gt, created_gte, created_lt, created_lte.

Query example

You can set up the display of the list of files in parts (for example, 10 files at a time):

  1. Show the first 10 files, starting with the one with the lowest ID.
  2. Show the remaining files (10 at a time) in ascending order.

Show the first 10 files

Production version
Sandbox
GET https://toloka.dev/api/v1/attachments?sort=id&limit=10
Authorization: OAuth <OAuth token>

Show the remaining tasks sorted by ascending ID

Production version
Sandbox
GET https://toloka.dev/api/v1/attachments?sort=id&limit=10&id_gt=<ID of the last file from the previous response>
Authorization: OAuth <OAuth token>

Response

{"items" : [{file #1}, {file #2}, ... {file #n}], "has_more": false}
PropertyDescription
items[]array of objects

Contains information about files.
has_more

boolean

Shows whether the list is complete.

Acceptable values:

  • true — Not all elements are included in the output due to restrictions in the limit parameter.

    You can get the rest of the results by using the _lt(e) and _gt(e) parameters.

    Learn more about standard query parameters.

  • false — The output contains all the items.

Contact support
Toloka API
OverviewAccessing the APIRate limiting
Quick start
Reference
Project
Pools
Training
Subscriptions to events
Toloker selection
Ways to upload tasks
Tasks
Task suites
Tracking operations
Getting responses
Checking completed tasks
Rewards
Messages for Tolokers
Various parameters
Libraries