Learn R Programming

MTurkR (version 0.2)

request: Execute an MTurk API Request

Description

This is the workhorse function that makes authenticated HTTP requests to the MTurk API. It is only provided for advanced users.

Usage

request(keyid, operation, signature, timestamp, GETparameters, 
		version = "2012-03-25", service = "AWSMechanicalTurkRequester", 
		browser = FALSE, log.requests = TRUE, sandbox = FALSE, 
		xml.parse = FALSE, print.errors = TRUE, validation.test = FALSE)

Arguments

keyid
An AWS Access Key ID.
operation
The MTurk API operation to be performed.
signature
A base64 encoded HMAC signature, as returned by authenticate.
timestamp
A timestamp, as returned by authenticate.
GETparameters
An optional character string containing URL query parameters that specify options for the request.
version
The version of the MTurk API to use. Default is 2012-03-25, under which the MTurkR package was built.
service
The MTurk service to which the authenticated request will be sent. Supplied only for advanced users.
browser
Optionally open the request in the default web browser, rather than opening in R. Default is FALSE.
log.requests
A logical specifying whether API requests should be logged. Default is TRUE. See readlogfile for details.
sandbox
Optionally execute the request in the MTurk sandbox rather than the live server. Default is FALSE.
xml.parse
Whether the returned list should contain parsed XML.
print.errors
Whether errors produced by the MTurk API request should be printed.
validation.test
Currently a logical that returns the URL of the specified REST request. Default is FALSE. May additionally validate the request (and supply information about that validation) in the future.

Value

  • A list containing the URL of the MTurk API REST request (request.url), the Request ID created by the API reqest (request.id), a logical indicating whether or not the request was valid and thus executed as intended (valid), and a character string containing the XML-formatted API response (xml).

Details

This is a mostly internal function that executes MTurk API requests. It is made available for use by advanced users to execute custom API requests (in tandem with authenticate). Even advanced users, however, should be satisifed with the functionality provided by genericmturkr.

References

http://docs.amazonwebservices.com/AWSMechTurk/latest/AWSMechanicalTurkRequester/MakingRequestsArticle.html{API Reference}

See Also

authenticate ParseErrorCodes