SendTestEventNotification

Description

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 your notification receptor logic without setting up notifications for a real HIT type and trying to trigger them using the web site.

When you call this operation, the service sends the test notification immediately. If the destination of your test notification is a web service, Amazon Mechanical Turk waits until your web service has responded, then returns a status report as its response to this operaton. Amazon Amazon Mechanical Turk returns an appropriate error message if your web service could not be contacted using the notification specification you provided.

Request Parameters

The SendTestEventNotification operation 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:

NameDescriptionRequired

Operation

The name of the operation

Type: String

Valid Values: SendTestEventNotification

Default: None

Yes

Notification

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

Type: a Notification data structure

Default: None

Yes

TestEventType

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.

Type: an EventType element of the Notification data structure.

Default: None

Yes

Response Elements

A successful request for the SendTestEventNotification operation returns with no errors. The response includes the elements described in the following table. The operation returns no other data.

NameDescription

SendTestEventNotificationResult

Contains a Request element if the Request ResposeGroup is specified.

Examples

The following example shows how to use the SendTestEventNotification operation.

Sample Request

The following example sends a notification message for a simulated AssignmentSubmitted event to be sent to a web service using the REST transport.

http://mechanicalturk.amazonaws.com/?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:80/mt/notifications.cgi
&Notification.1.Transport=REST
&Notification.1.Version=2006-05-05
&Notification.1.EventType=AssignmentSubmitted
&TestEventType=AssignmentSubmitted
         

Sample Response

The following is an example response.

<SendTestEventNotificationResult>
  <Request>
    <IsValid>True</IsValid>
  </Request>
</SendTestEventNotificationResult>