SendTestEventNotification: Test a Notification

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Test a HITType Notification, for example, to try out a HITType Notification before creating a HIT.

Usage

1
2
3
4
5
SendTestEventNotification(
  notification,
  test.event.type,
  verbose = getOption("pyMTurkR.verbose", TRUE)
)

Arguments

notification

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

test.event.type

A character string containing one of: AssignmentAccepted, AssignmentAbandoned, AssignmentReturned, AssignmentSubmitted, AssignmentRejected, AssignmentApproved, HITCreated, HITExtended, HITDisposed, HITReviewable, HITCreated, HITExtended, HITDisposed, HITReviewable, HITExpired (the default), or Ping.

verbose

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

Details

Test a Notification configuration. The test mimics whatever the Notification configuration will do when the event described in test.event.type occurs. For example, if a Notification has been configured to send an email any time an Assignment is Submitted, testing for an AssignmentSubmitted event should trigger an email. Similarly, testing for an AssignmentReturned event should do nothing.

notificationtest is an alias.

Value

A data frame containing the notification, the event type, and details on whether the request was valid. As a side effect, a notification will be sent to the configured destination (either an email or an SQS queue).

Author(s)

Tyler Burleigh, Thomas J. Leeper

References

API Reference

See Also

SetHITTypeNotification

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
hittype <- RegisterHITType(title="10 Question Survey",
                           description = "Complete a 10-question survey",
                           reward = ".20",
                           duration = seconds(hours = 1),
                           keywords = "survey, questionnaire, politics")

a <- GenerateNotification("requester@example.com", event.type = "HITExpired")

SetHITTypeNotification(hit.type = hittype$HITTypeId,
                       notification = a,
                       active = TRUE)

## End(Not run)

pyMTurkR documentation built on Nov. 25, 2021, 9:07 a.m.