SetHITTypeNotification: Configure a HITType Notification

SetHITTypeNotificationR Documentation

Configure a HITType Notification

Description

Configure a notification to be sent when specific actions occur for the specified HITType.

Usage

SetHITTypeNotification(
  hit.type,
  notification = NULL,
  active = NULL,
  verbose = getOption("pyMTurkR.verbose", TRUE)
)

Arguments

hit.type

A character string specifying the HITTypeId of the HITType for which notifications are being configured.

notification

An optional dictionary object Notification structure (e.g., returned by GenerateNotification).

active

A logical indicating whether the Notification is active or inactive.

verbose

Optionally print the results of the API request to the standard output. Default is taken from getOption('pyMTurkR.verbose', TRUE).

Details

Configure a notification to be sent to the requester whenever an event (specified in the Notification object) occurs. This is useful, for example, to enable email notifications about when assignments are submitted or HITs are completed, or for other HIT-related events.

Email notifications are useful for small projects, but configuring notifications to use the Amazon Simple Queue Service (SQS) is more reliable for large projects and allows automated processing of notifications.

setnotification() is an alias.

Value

A data frame containing details of the Notification and whether or not the request was successfully executed by MTurk.

Once configured, events will trigger a side effect in the form of a notification sent to the specified transport (either an email address or SQS queue). That notification will contain the following details: EventType, EventTime, HITTypeId, HITId, and (if applicable) AssignmentId.

Note that the 'Notification' column in this dataframe is a dictionary object coerced into a character type. This cannot be used again directly as a notification parameter, but it can be used to re-construct the dictionary object.

Author(s)

Tyler Burleigh, Thomas J. Leeper

References

API Reference: Operation

API Reference: Concept

See Also

GenerateNotification

SendTestEventNotification

Examples


## Not run: 
# setup email notification
hittype <- RegisterHITType(title = "10 Question Survey",
                description = "Complete a 10-question survey",
                reward = ".20",
                duration = seconds(hours = 1),
                keywords = "survey, questionnaire, politics")

a <- GenerateNotification("user@gmail.com", "Email", "AssignmentAccepted")
SetHITTypeNotification(hit.type = hittype$HITTypeId,
                       notification = a,
                       active = TRUE)

# send test notification
SendTestEventNotification(a, test.event.type = "AssignmentAccepted")

## End(Not run)


pyMTurkR documentation built on May 29, 2024, 6:13 a.m.