Toloka documentation

get_message_threads

toloka.client.TolokaClient.get_message_threads

Finds all message threads that match certain rules and returns them in an iterable object

Unlike find_message_threads, returns generator. Does not sort threads. While iterating over the result, several requests to the Toloka server is possible.

Parameters Description

Parameters Type Description
folder Union[str, Folder, List[Union[str, Folder]], None]

Folders to search for the thread

folder_ne Union[str, Folder, List[Union[str, Folder]], None]

Folders to not search for the thread

id_lt Optional[str]

Threads with an ID less than the specified value.

id_lte Optional[str]

Threads with an ID less than or equal to the specified value.

id_gt Optional[str]

Threads with an ID greater than the specified value.

id_gte Optional[str]

Threads with an ID 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.

  • Yields:

    The next object corresponding to the request parameters.

  • Yield type:

    Generator[MessageThread, None, None]

Examples:

How to get all unread incoming messages.

message_threads = toloka_client.get_message_threads(folder=['INBOX', 'UNREAD'])