Toloka documentation

find_user_bonuses

toloka.client.TolokaClient.find_user_bonuses

Finds all user bonuses that match certain rules

As a result, it returns an object that contains the first part of the found user bonuses and whether there are any more results. It is better to use the "get_user_bonuses" method, they allow to iterate trought all results and not just the first output.

Parameters Description

Parameters Type Description
user_id Optional[str]

Performer ID.

assignment_id Optional[str]

ID of the performer's response to the task a reward is issued for.

private_comment Optional[str]

Comments for the requester.

id_lt Optional[str]

Bonuses with an ID less than the specified value.

id_lte Optional[str]

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

id_gt Optional[str]

Bonuses with an ID greater than the specified value.

id_gte Optional[str]

Bonuses with an ID greater than or equal to the specified value.

created_lt Optional[datetime]

Bonuses awarded before the specified date.

created_lte Optional[datetime]

Bonuses awarded before or on the specified date.

created_gt Optional[datetime]

Bonuses awarded after the specified date.

created_gte Optional[datetime]

Bonuses awarded after or on the specified date.

sort Union[List[str], UserBonusSortItems, None]

How to sort result. Defaults to None.

limit Optional[int]

Limit on the number of results returned.

  • Returns:

    The first limit user bonuses in items. And a mark that there is more.

  • Return type:

    UserBonusSearchResult

Examples:

toloka_client.find_user_bonuses(user_id='1', sort=['-created', '-id'], limit=3)

If method finds more objects than custom or system limit allows to operate, it will also show an indicator has_more=True.