Get the list of all the message threads present in a specific folder in your account.
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 message threads calling the get_message_threads()
method.
for message_thread in toloka_client.get_message_threads(folder=['INBOX', 'UNREAD']):
topic=message_thread.topic
print(message_thread.id, topic.get('EN') or list(topic.values())[0])
You should get an output with the message thread IDs and topics which looks like this.
63c00f08138adb3ab310b2a5 Perfect job!63c1573b138adb3ab310b2af Thank you!
import toloka.client as tolokatoloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')for message_thread in toloka_client.get_message_threads(folder=['INBOX', 'UNREAD']): topic=message_thread.topic print(message_thread.id, topic.get('EN') or list(topic.values())[0])
Last updated: February 7, 2023