Learn R Programming

MTurkR (version 0.6.17)

request: Execute an MTurk API Request

Description

This is the workhorse function that makes authenticated HTTP requests to the MTurk API. It is not exported as of v0.5.

Usage

request(operation, GETparameters = NULL,
        keypair = getOption('MTurkR.keypair'),
        browser = getOption('MTurkR.browser', FALSE),
        log.requests = getOption('MTurkR.log', TRUE),
        sandbox = getOption('MTurkR.sandbox', FALSE), 
        verbose = getOption('MTurkR.verbose', TRUE),
        validation.test = getOption('MTurkR.test', FALSE),
        service = "AWSMechanicalTurkRequester",
        version = NULL)

Arguments

operation
The MTurk API operation to be performed.
GETparameters
An optional character string containing URL query parameters that specify options for the request.
keypair
A two-element character vector containing an AWS Access Key ID and an AWS Secret Access Key. Default is from options('MTurkR.keypair').
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.
verbose
Whether errors produced by the MTurk API request should be printed.
validation.test
Currently a logical that causes request to return the URL of the specified REST request. Default is FALSE. May additionally validate the request (and supply information about that validation) in the future.
service
The MTurk service to which the authenticated request will be sent. Supplied only for advanced users.
version
The version of the MTurk API to use.

Value

  • A list of class MTurkResponse containing:
  • operationA character string identifying the MTurk API operation performed.
  • request.idThe Request ID created by the API request.
  • request.urlThe URL of the MTurk API REST request.
  • validA logical indicating whether or not the request was valid and thus executed as intended.
  • xmlA character string containing the XML API response.

Details

This is an internal function that executes MTurk API requests. It is made available for use by advanced users to execute custom API requests.

References

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