SetHITTypeNotification

The SetHITTypeNotification operation creates, updates, disables or re-enables notifications for a HIT type.

When a HIT type has an active notification, Mechanical Turk will attempt to send a notification message when a HIT of the type changes state, such as when an assignment is submitted for the HIT. The state changes to watch and the method of notification are described in the notification specification given to SetHITTypeNotification.

If SetHITTypeNotification is called for a HIT type that already has a notification specification, it replaces the old specification with a new one.

You can also call SetHITTypeNotification to enable or disable notifications for the HIT type, without having to modify the notification specification itself.

You cannot delete a notification specification for a HIT type, you can only disable it.

Note:

Changes to a HIT type's notification specification may take up to five minutes to take effect after the call to SetHITTypeNotification has been made.

For more information on notifications, see Notifications. For more information on developing a notification receptor application, see The Notification Receptor API.

The following example of a call to the SetHITTypeNotification operation sets the notification specification for a HIT type to send the Requester e-mail whenever a Worker submits an assignment for a HIT of the type.

http://mechanicalturk.amazonaws.com/onca/xml?Service=AWSMechanicalTurkRequester
&AWSAccessKeyId=[the Requester's Access Key ID]
&Operation=SetHITTypeNotification
&Signature=[signature for this request]
&Timestamp=[your system's local time]
&HITTypeId=T100CN9P324W00EXAMPLE
&Notification.1.Destination=requester-email@example.com
&Notification.1.Transport=Email
&Notification.1.Version=2006-10-31
&Notification.1.EventType=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.

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

The following parameters are specific to the SetHITTypeNotification operation:

NameDescriptionTypeValue
Operation

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

Required

SetHITTypeNotification

HITTypeId

The ID of the HIT type whose notification specification is being updated, as returned by RegisterHITType.

Required

A valid HIT type ID

Notification

The notification specification for the HIT type.

This parameter is optional. If not specified, the HIT type's notification specification (if any) is not modified.

Either Notification or Active must be specified for the call to SetHITTypeNotification to succeed.

Optional

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

Active

If true, notifications will be sent for HITs of this HIT type, according to the notification specification. If false, notifications will not be sent.

This value can be changed for a HIT type at any time by calling this operation. You can specify changes to the active status without specifying a new notification specification (the Notification parameter).

This parameter is optional. If omitted, the active status of the HIT type's notification specification is unchanged. All HIT types begin with their notification specifications in the "active" status.

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 SetHITTypeNotification.

Either Notification or Active must be specified for the call to SetHITTypeNotification to succeed.

Optional

A Boolean value, true or false

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