send_bonus
async
¶
send_bonus(
worker_id: CustomerId,
bonus_amount: CurrencyAmount,
assignment_id: EntityId,
reason: String,
*,
config_overrides: Optional[AsyncMTurkClientConfig] = None,
unique_request_token: Optional[IdempotencyToken] = None,
) -> SendBonusResponse
The SendBonus operation issues a payment of money from your account to a Worker. This payment happens separately from the reward you pay to the Worker when you approve the Worker's assignment. The SendBonus operation requires the Worker's ID and the assignment ID as parameters to initiate payment of the bonus. You must include a message that explains the reason for the bonus payment, as the Worker may not be expecting the payment. Amazon Mechanical Turk collects a fee for bonus payments, similar to the HIT listing fee. This operation fails if your account does not have enough funds to pay for both the bonus and the fees.
Parameters:
-
worker_id(CustomerId) –The ID of the Worker being paid the bonus.
-
bonus_amount(CurrencyAmount) –The Bonus amount is a US Dollar amount specified using a string (for example, "5" represents $5.00 USD and "101.42" represents $101.42 USD). Do not include currency symbols or currency codes.
-
assignment_id(EntityId) –The ID of the assignment for which this bonus is paid.
-
reason(String) –A message that explains the reason for the bonus payment. The Worker receiving the bonus can see this message.
-
unique_request_token(Optional[IdempotencyToken], default:None) –A unique identifier for this request, which allows you to retry the call on error without granting multiple bonuses. This is useful in cases such as network timeouts where it is unclear whether or not the call succeeded on the server. If the bonus already exists in the system from a previous call using the same UniqueRequestToken, subsequent calls will return an error with a message containing the request ID.
Raises:
-
RequestError–Your request is invalid.
-
ServiceFault–Amazon Mechanical Turk is temporarily unable to process your request. Try your call again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_mturk/_services/async_m_turk.py
2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 | |