Get list of responses

Get all the Toloker responses present in the pool with the ID specified in the request.

Steps to follow

1. Import Toloka-Kit

Connect the Toloka-Kit library to your script.

import toloka.client as toloka

2. Instantiate TolokaClient

Replace the sample API key with your own one.

toloka_client = toloka.
TolokaClient
('PlaceYourRealApiKey_Here', 'PRODUCTION');

3. Print responses IDs and statuses

Iterate through all the Toloker responses present in the pool with the ID specified in the request calling the get_assignments() method.

for assignment in toloka_client.
get_assignments
(pool_id='1085757'):

print(assignment.id, assignment.status)

You should get an output with the response IDs and statuses which looks like this.

000015fccc--63bfc4c358d7a46c32a7b233 Status.ACCEPTED
000015fccc--63bfc4e0ed43982367a5ad46 Status.REJECTED
000015fccc--63bfc4ea99e537000bac4015 Status.SUBMITTED

Complete code: Get list of responses

import toloka.client as toloka
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')
for assignment in toloka_client.get_assignments(pool_id='1085757'):
print(assignment.id, assignment.status)
List of classes and methods used in this recipe

See also

Last updated: February 7, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming