API quick start

Choose a solution

Request a list of solutions and choose the one that fits your goals.

In this example, we'll run the "Text Classification" solution.

GET /api/app/v0/apps
Host: https://toloka.dev
Authorization: OAuth <OAuth token>
Response

Get information about the solution

Request information about the solution to check the spec parameters and input data.

For example, to view the "Text Classification" solution specs, specify its id in the request: 2eN4l59qL2xHB5b8Jqp6.

GET /api/app/v0/apps/2eN4l59qL2xHB5b8Jqp6
Host: https://toloka.dev
Authorization: OAuth <OAuth token>
Response

Create a project

Create an object named parameters. It should match the JSON schema in the solution's param_spec.

POST /api/app/v0/app-projects
Host: https://toloka.dev
Authorization: OAuth <OAuth token>
Request body
Response

Now you have the app_project_id of your project. In this case, it's 6Vv8kdlrjLYu7ZgPdezj.

The project gets the CREATING status. You don't have to wait until it's moderated and can immediately start uploading task items.

Create a batch for labeling

Let's create a batch and upload task items to it. We'll use the schema from the project template. It's specified in the input_spec parameter. In this case, it's id and text.

POST /api/app/v0/app-projects/6Vv8kdlrjLYu7ZgPdezj/batches
Host: https://toloka.dev
Authorization: OAuth <OAuth token>
Request body
Response

Wait for the READY status

At this stage, you need to wait until the project's status changes to READY.

To find out the status of the project, use the request:

GET https://toloka.dev/api/app/v0/app-projects/6Vv8kdlrjLYu7ZgPdezj

Start processing the batch

POST /api/app/v0/app-projects/6Vv8kdlrjLYu7ZgPdezj/batches/z1Qy7aryrj9har9yKdY0/start
Host: https://toloka.dev
Authorization: OAuth <OAuth token>

Check the status of the project's task items

Check the status of the task items from time to time:

  • NEW: A new object.
  • PROCESSING: The object is being processed.
  • COMPLETED: Object processing is complete.

The expected status is COMPLETED.

GET /api/app/v0/app-projects/6Vv8kdlrjLYu7ZgPdezj/items?batch_id=z1Qy7aryrj9har9yKdY0
Host: https://toloka.dev
Authorization: OAuth <OAuth token>
Response

Parameters

ParameterOverview
app_project_idstring

Project ID.
batch_idstring

Batch ID.
Contact support