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/appsHost: https://toloka.devAuthorization: OAuth <OAuth token>
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/2eN4l59qL2xHB5b8Jqp6Host: https://toloka.devAuthorization: OAuth <OAuth token>
Create an object named parameters
. It should match the JSON schema in the solution's param_spec
.
POST /api/app/v0/app-projectsHost: https://toloka.devAuthorization: OAuth <OAuth token>
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.
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/batchesHost: https://toloka.devAuthorization: OAuth <OAuth token>
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
POST /api/app/v0/app-projects/6Vv8kdlrjLYu7ZgPdezj/batches/z1Qy7aryrj9har9yKdY0/startHost: https://toloka.devAuthorization: OAuth <OAuth token>
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=z1Qy7aryrj9har9yKdY0Host: https://toloka.devAuthorization: OAuth <OAuth token>
Parameter | Overview |
---|---|
app_project_id | string Project ID. |
batch_id | string Batch ID. |