SendTestEventNotification

The SendTestEventNotification operation causes Mechanical Turk to send a notification message as if a HIT event occurred, according to the provided notification specification. This allows you to test your notification receptor logic without setting up notifications for a real HIT type and trying to trigger them using the web site.

When the operation is called, the service sends the test notification immediately. If your test notification's destination is a web service, Mechanical Turk will wait until your web service has responded, then return a status report as its response to the call to SendTestEventNotification. Mechanical Turk will return an appropriate error message if your web service could not be contacted using the notification specification you provided.

Mechanical Turk always includes a "Ping" event in the notification message sent from a call to SendTestEventNotification. You can also specify a specific event type to be included in the message, as if an event of that type occurred.

The following example of a call to the SendTestEventNotification operation sends a notification message for a simulated "AssignmentSubmitted" event (as well as a "Ping" event), to be sent to a web service using the REST transport.

http://mechanicalturk.amazonaws.com/onca/xml?Service=AWSMechanicalTurkRequester
&AWSAccessKeyId=[the Requester's Access Key ID]
&Operation=SendTestEventNotification
&Signature=[signature for this request]
&Timestamp=[your system's local time]
&Notification.1.Destination=http://example.com:8080/mt/notifications.cgi
&Notification.1.Transport=REST
&Notification.1.Version=2006-10-31
&Notification.1.EventType=AssignmentSubmitted
&TestEventType=AssignmentSubmitted

A request to the Mechanical Turk Service includes parameters that control its behavior and the data it returns. Required parameters must be included for the request to succeed.

SendTestEventNotification accepts parameters common to all operations. Some common parameters are required. See Common Parameters for more information.

The following parameters are specific to the SendTestEventNotification operation:

NameDescriptionTypeValue
Operation

The operation you would like to call. To access the SendTestEventNotification operation, set the Operation parameter to SendTestEventNotification.

Required

SendTestEventNotification

Notification

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

Required

A Notification data structure. For more information on the data structure of a notification specification, see the Notification Data Structure.

TestEventType

The event to simulate to test the notification specification.

Optional

A valid event type. See the Notification Data Structure (the EventType element) for a complete list of event type values.

The event specified by TestEventType will be included in the test message even if the notification specification does not include the event type. (The notification specification will not "filter" out the test event.)

This parameter is optional. If not provided, only the "Ping" event message will be sent.

A successful request for the SendTestEventNotification operation will return with no errors. The response will include a SendTestEventNotification element, which contains the Request (if the Request response group is specified). The operation returns no other data.