get_user_bonuses

toloka.client.TolokaClient.get_user_bonuses | Source code

Finds all Tolokers' bonuses that match certain rules and returns them in an iterable object

get_user_bonuses returns a generator. You can iterate over all found Tolokers' bonuses using the generator. Several requests to the Toloka server are possible while iterating.

If you need to sort bonuses use the find_user_bonuses method.

Parameters description

ParametersTypeDescription
user_idOptional[str]

The ID of a Toloker.

assignment_idOptional[str]

The ID of an assignment a bonus was granted for.

private_commentOptional[str]

Bonuses with specified comment.

id_ltOptional[str]

Bonuses with IDs less than the specified value.

id_lteOptional[str]

Bonuses with IDs less than or equal to the specified value.

id_gtOptional[str]

Bonuses with IDs greater than the specified value.

id_gteOptional[str]

Bonuses with IDs greater than or equal to the specified value.

created_ltOptional[datetime]

Bonuses given before the specified date.

created_lteOptional[datetime]

Bonuses given before or on the specified date.

created_gtOptional[datetime]

Bonuses given after the specified date.

created_gteOptional[datetime]

Bonuses given after or on the specified date.

batch_sizeOptional[int]

A limit of items returned by each request to Toloka. The maximum allowed value: 300.

  • Yields:

    The next matching Toloker's bonus.

  • Yield type:

    Generator[UserBonus, None, None]

Examples:

bonuses = list(toloka_client.get_user_bonuses(created_lt='2023-06-01T00:00:00'))

Last updated: August 28, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming