Get reward details

Get the detailed information about the reward with the ID specified in the request.

Steps to follow

1. Import Toloka-Kit

Connect the Toloka-Kit library to your script.

import toloka.client as toloka

2. Instantiate TolokaClient

Replace the sample OAuth token with your own one.

toloka_client = toloka.
('AQC2AGAJgyNSA8CtpdO9MWy_QEB6s6kDjHUoElE', 'PRODUCTION');

3. Get reward information

Find out the ID of the reward for which you want to get the detailed information. Then get this info calling the get_user_bonus() method.

bonus = toloka_client.
('3139')

4. Print reward title and amount

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 reward title and amount which looks like this.

Perfect job! 0.500

Complete code: Get reward details

import toloka.client as toloka
toloka_client = toloka.TolokaClient('AQC2AGAJgyNSA8CtpdO9MWy_QEB6s6kDjHUoElE', 'PRODUCTION')
bonus = toloka_client.get_user_bonus('3139')
print(bonus.public_title['EN'], bonus.amount)
List of classes and methods used in this recipe

See also

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