Amazon Mechanical Turk

2017/09/29 - Amazon Mechanical Turk - 2 updated api methods

SendTestEventNotification (updated) Link ¶
Changes (request)
{'Notification': {'Transport': {'SNS'}}}

The SendTestEventNotification operation causes Amazon Mechanical Turk to send a notification message as if a HIT event occurred, according to the provided notification specification. This allows you to test notifications without setting up notifications for a real HIT type and trying to trigger them using the website. When you call this operation, the service attempts to send the test notification immediately.

See also: AWS API Documentation

Request Syntax

client.send_test_event_notification(
    Notification={
        'Destination': 'string',
        'Transport': 'Email'|'SQS'|'SNS',
        'Version': 'string',
        'EventTypes': [
            'AssignmentAccepted'|'AssignmentAbandoned'|'AssignmentReturned'|'AssignmentSubmitted'|'AssignmentRejected'|'AssignmentApproved'|'HITCreated'|'HITExpired'|'HITReviewable'|'HITExtended'|'HITDisposed'|'Ping',
        ]
    },
    TestEventType='AssignmentAccepted'|'AssignmentAbandoned'|'AssignmentReturned'|'AssignmentSubmitted'|'AssignmentRejected'|'AssignmentApproved'|'HITCreated'|'HITExpired'|'HITReviewable'|'HITExtended'|'HITDisposed'|'Ping'
)
type Notification

dict

param Notification

[REQUIRED]

The notification specification to test. This value is identical to the value you would provide to the UpdateNotificationSettings operation when you establish the notification specification for a HIT type.

  • Destination (string) -- [REQUIRED]

    The target for notification messages. The Destination’s format is determined by the specified Transport:

    • When Transport is Email, the Destination is your email address.

    • When Transport is SQS, the Destination is your queue URL.

    • When Transport is SNS, the Destination is the ARN of your topic.

  • Transport (string) -- [REQUIRED]

    The method Amazon Mechanical Turk uses to send the notification. Valid Values: Email | SQS | SNS.

  • Version (string) -- [REQUIRED]

    The version of the Notification API to use. Valid value is 2006-05-05.

  • EventTypes (list) -- [REQUIRED]

    The list of events that should cause notifications to be sent. Valid Values: AssignmentAccepted | AssignmentAbandoned | AssignmentReturned | AssignmentSubmitted | AssignmentRejected | AssignmentApproved | HITCreated | HITExtended | HITDisposed | HITReviewable | HITExpired | Ping. The Ping event is only valid for the SendTestEventNotification operation.

    • (string) --

type TestEventType

string

param TestEventType

[REQUIRED]

The event to simulate to test the notification specification. This event is included in the test message even if the notification specification does not include the event type. The notification specification does not filter out the test event.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

UpdateNotificationSettings (updated) Link ¶
Changes (request)
{'Notification': {'Transport': {'SNS'}}}

The UpdateNotificationSettings operation creates, updates, disables or re-enables notifications for a HIT type. If you call the UpdateNotificationSettings operation for a HIT type that already has a notification specification, the operation replaces the old specification with a new one. You can call the UpdateNotificationSettings operation to enable or disable notifications for the HIT type, without having to modify the notification specification itself by providing updates to the Active status without specifying a new notification specification. To change the Active status of a HIT type's notifications, the HIT type must already have a notification specification, or one must be provided in the same call to UpdateNotificationSettings .

See also: AWS API Documentation

Request Syntax

client.update_notification_settings(
    HITTypeId='string',
    Notification={
        'Destination': 'string',
        'Transport': 'Email'|'SQS'|'SNS',
        'Version': 'string',
        'EventTypes': [
            'AssignmentAccepted'|'AssignmentAbandoned'|'AssignmentReturned'|'AssignmentSubmitted'|'AssignmentRejected'|'AssignmentApproved'|'HITCreated'|'HITExpired'|'HITReviewable'|'HITExtended'|'HITDisposed'|'Ping',
        ]
    },
    Active=True|False
)
type HITTypeId

string

param HITTypeId

[REQUIRED]

The ID of the HIT type whose notification specification is being updated.

type Notification

dict

param Notification

The notification specification for the HIT type.

  • Destination (string) -- [REQUIRED]

    The target for notification messages. The Destination’s format is determined by the specified Transport:

    • When Transport is Email, the Destination is your email address.

    • When Transport is SQS, the Destination is your queue URL.

    • When Transport is SNS, the Destination is the ARN of your topic.

  • Transport (string) -- [REQUIRED]

    The method Amazon Mechanical Turk uses to send the notification. Valid Values: Email | SQS | SNS.

  • Version (string) -- [REQUIRED]

    The version of the Notification API to use. Valid value is 2006-05-05.

  • EventTypes (list) -- [REQUIRED]

    The list of events that should cause notifications to be sent. Valid Values: AssignmentAccepted | AssignmentAbandoned | AssignmentReturned | AssignmentSubmitted | AssignmentRejected | AssignmentApproved | HITCreated | HITExtended | HITDisposed | HITReviewable | HITExpired | Ping. The Ping event is only valid for the SendTestEventNotification operation.

    • (string) --

type Active

boolean

param Active

Specifies whether notifications are sent for HITs of this HIT type, according to the notification specification. You must specify either the Notification parameter or the Active parameter for the call to UpdateNotificationSettings to succeed.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --