The Notification data structure describes a HIT event notification for a HIT type. If a HIT type has a notification specification for a kind of event, when a HIT of the type has the specified event, Mechanical Turk sends a notification message according to the specification.
The specification includes the types of events being watched, the e-mail address or HTTP URL of the destination of the message, which transport to use (e-mail, SOAP or REST), and which version of the notification message schemas to use (for SOAP and REST messages).
The Notification data structure is used as a parameter for the following operations:
SetHITTypeNotification
SendTestEventNotification
The following example notification specification says that when
a HIT (of the HIT type whose notifications specification this
is) has an assignment returned or abandoned by a Worker, the web
service application at the given URL should be notified with a
REST-style web service call, using the 2006-08-23 version of the
notification message schema.
<Notification> <Destination>http://example.com:8080/mt/notifications.cgi</Destination> <Transport>REST</Transport> <Version>2006-08-23</Version> <EventType>AssignmentAbandoned</EventType> <EventType>AssignmentReturned</EventType> </Notification>
The Notification structure may contain the following elements. When the structure is used in a request, elements described as "required" must be included for the request to succeed.
| Name | Description | Type | Value |
|---|---|---|---|
Destination
|
The destination for notification messages. For e-mail notifications, this is an e-mail address. For web service (SOAP or REST) notifications, this is the URL end point for your application's notification receptor. | Required |
For e-mail notifications, a valid e-mail address. For SOAP or REST notifications, a valid HTTP URL. |
Transport
|
The method Mechanical Turk will use to send the notification.
For | Required |
|
Version
|
The version of the notification WSDL/schema to use for SOAP or REST notifications. For more information about schema versions, see Elements of a Notification Message. | Required |
A version identifier |
EventType
|
The events that should cause notifications to be sent.
Multiple event types can be specified by repeating the
The | Required |
|