toloka.client.TolokaClient.get_message_threads
| Source code
Finds all message threads that match certain criteria.
get_message_threads
returns a generator. You can iterate over all found message threads using the generator. Several requests to the Toloka server are possible while iterating.
If you need to sort message threads use the find_message_threads method.
Parameters | Type | Description |
---|---|---|
folder | Union[str, Folder, List[Union[str, Folder]], None] | A folder where to search threads or a list of folders. Refer to the Folder page for more information on the available |
folder_ne | Union[str, Folder, List[Union[str, Folder]], None] | A folder to skip or a list of folders. Supported values are the same as for |
id_lt | Optional[str] | Threads with IDs less than the specified value. |
id_lte | Optional[str] | Threads with IDs less than or equal to the specified value. |
id_gt | Optional[str] | Threads with IDs greater than the specified value. |
id_gte | Optional[str] | Threads with IDs greater than or equal to the specified value. |
created_lt | Optional[datetime] | Threads created before the specified date. |
created_lte | Optional[datetime] | Threads created before or on the specified date. |
created_gt | Optional[datetime] | Threads created after the specified date. |
created_gte | Optional[datetime] | Threads created after or on the specified date. |
batch_size | Optional[int] | A limit of items returned by each request to Toloka. The maximum allowed value: 300. The default value: 50. |
Yields:
The next matching message thread.
Yield type:
Generator[MessageThread, None, None]
Examples:
How to get all unread incoming messages.
message_threads = toloka_client.get_message_threads(folder=['INBOX', 'UNREAD'])
Last updated: August 28, 2023