List all the files attached to the Toloker responses in a pool.
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');
Find out the ID of the pools for which you want to get all the files attached to the Toloker responses. Then iterate through all the attachments calling the get_attachments()
method.
for attachment in toloka_client.get_attachments(pool_id='1085757'):
print(attachment.id, attachment.name)
You should get an output that contains the IDs of the attachments and file names. It will look like this.
fr.5867be74-249b-4264-9ed0-aa5d4c201846 gx6864-almost-blue-1.jpgfr.c548ebeb-dd92-4b2b-8113-4a69af1471ba nike_104090949.pngfr.cd9cdda5-4af6-4be9-b351-678b2b4e189f 37540601-sneaker-search.jpg
import toloka.client as tolokatoloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')for attachment in toloka_client.get_attachments(pool_id='1085757'): print(attachment.id, attachment.name)
Last updated: February 7, 2023