qualtRics (version 2.0)

registerOptions: Register qualtrics API key, root url and other options

Description

This function registers the user's qualtrics API key, root url and other options for the remainder of the R session. This function only needs to be called once (at the beginning of each R session).

Usage

registerOptions(verbose = TRUE, ...)

Arguments

verbose

Verbose. If TRUE, verbose messages will be printed to the R console. Defaults to TRUE.

...

Either empty or both a parameter called 'api_token' and 'root_url' to register the Qualtrics api key and institution-specific root url manually. (see example).

See Also

See https://github.com/JasperHG90/qualtRics/blob/master/README.md#using-a-configuration-file for more information about the qualtRics configuration file. See: https://api.qualtrics.com/docs/authentication to find your Qualtrics API key and https://api.qualtrics.com/docs/root-url for more information about the institution-specific root url.

Examples

Run this code
# NOT RUN {
# Register your Qualtrics credentials if you haven't already
registerOptions(api_token="<YOUR-API-TOKEN>", root_url="<YOUR-ROOT-URL>")
# Retrieve a list of surveys
surveys <- getSurveys()
# Retrieve a single survey
mysurvey <- getSurvey(surveyID = surveys$id[6],
                      save_dir = tempdir(),
                      verbose=TRUE)
# You can use the same parameters as those found in the qualtrics API documentation
# Found here: https://api.qualtrics.com/docs/csv
mysurvey <- getSurvey(surveyID = surveys$id[6],
                      save_dir = tempdir(),
                      startDate = "2017-01-01",
                      endDate = "2017-01-31",
                      limit = 100,
                      useLabels = TRUE,
                      seenUnansweredRecode = "UNANS",
                      verbose=TRUE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace