Get the list of all the Toloker bans.
Connect the Toloka-Kit library to your script.
import toloka.client as toloka
Replace the sample API key with your own one.
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION');
Iterate through all the bans calling the get_user_restrictions()
method. Specify the scope which was used to restrict the Toloker access:
ALL_PROJECTS
includes the Tolokers which have been banned from accessing all your projects.
PROJECT
includes the Tolokers which have been banned from accessing a single project. Specify the project ID as an argument: project_id='120798'
.
POOL
includes the Tolokers which have been banned from accessing a single project. Specify the pool ID as an argument: pool_id='38955320'
.
for restriction in toloka_client.get_user_restrictions(scope='PROJECT', project_id='120798'):
print(restriction.id, restriction.user_id, restriction.created)
You should get an output with the ban IDs, Toloker IDs, and ban creation dates which looks like this.
163294518 19025b33f844331a1c2c7ff57ec520b0 2023-07-18 15:31:28.459000+00:00163295269 240d5b7897f98c119cd892e34295587e 2023-07-18 15:41:02.992000+00:00
import toloka.client as tolokatoloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')for restriction in toloka_client.get_user_restrictions(scope='PROJECT', project_id='120798'): print(restriction.id, restriction.user_id, restriction.created)
Last updated: July 19, 2023