Get the detailed information about the bonus with the ID specified in the request.
Connect the Toloka-Kit library to your script.
import toloka.client as toloka
Replace the sample API key with your own one.
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION');
Find out the ID of the bonus for which you want to get the detailed information. Then get this info calling the get_user_bonus()
method.
bonus = toloka_client.get_user_bonus('3139')
The get_user_bonus()
request will return the UserBonus class object. You can use its attributes to print the information you need.
print(bonus.public_title['EN'], bonus.amount)
You should get an output with the bonus title and amount which looks like this.
Perfect job! 0.500
import toloka.client as tolokatoloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')bonus = toloka_client.get_user_bonus('3139')print(bonus.public_title['EN'], bonus.amount)
Last updated: February 7, 2023