toloka.client.TolokaClient.create_user_bonuses_async
| Source code
Issues payments directly to Tolokers, asynchronously creates many UserBonus
instances.
You can send a maximum of 10,000 requests of this kind per day.
Parameters | Type | Description |
---|---|---|
user_bonuses | List[UserBonus] | To whom, how much to pay and for what. |
operation_id | Optional[UUID] | Operation ID. If asynchronous creation is used, by this identifier you can later get results of creating bonuses. |
skip_invalid_items | Optional[bool] | Validation parameters of objects:
|
Returns:
An operation upon completion of which the bonuses can be considered created.
Return type:
Examples:
import decimalnew_bonuses=[ UserBonus( user_id='1', amount=decimal.Decimal('0.50'), public_title={ 'EN': 'Perfect job!', 'RU': 'Прекрасная работа!', }, public_message={ 'EN': 'You are the best!', 'RU': 'Молодец!', }, assignment_id='1' ), UserBonus( user_id='2', amount=decimal.Decimal('1.0'), public_title={ 'EN': 'Excellent work!', 'RU': 'Превосходная работа!', }, public_message={ 'EN': 'You have completed all tasks!', 'RU': 'Сделаны все задания!', }, assignment_id='2' )]create_bonuses = toloka_client.create_user_bonuses_async(new_bonuses)toloka_client.wait_operation(create_bonuses)