request: Send a request to the Qualtrics API

Description Usage Arguments Details Value Examples

View source: R/request.R

Description

'request' is a lower-level function for direct access to API actions. It may be useful in programming.

Usage

1
2
3
request(verb = c("GET", "POST", "PUT", "DELETE"), action,
  token = Sys.getenv("QUALTRICS_TOKEN"),
  subdomain = Sys.getenv("QUALTRICS_SUBDOMAIN"), verbose = FALSE, ...)

Arguments

verb

Name of verb to use.

action

Either an API action (like "surveys") or a complete API URL.

token

A Qualtrics API token (by default, the value of the environment variable QUALTRICS_TOKEN).

subdomain

A Qualtrics subdomain (by default, the value of the environment variable QUALTRICS_SUBDOMAIN). Ignored if 'action' is a complete API URL.

verbose

Output API calls to stderr.

...

Further arguments to the function given by verb, e.g., GET.

Details

For help with subdomains, see the Qualtrics documentation. Each Qualtrics account is assigned a subdomain, and using another will work but produce a warning.

Value

For request, a response object. For qget and qpost, its content as extracted by content.

Examples

1
2
3
4
## Not run: 
response <- request("GET", "surveys")

## End(Not run)

cloudyr/qualtrics documentation built on May 13, 2019, 8:21 p.m.