fetch_description: Download complete survey description using the Qualtrics v3...

View source: R/fetch_description.R

fetch_descriptionR Documentation

Download complete survey description using the Qualtrics v3 "Get Survey" API endpoint.


Download complete survey description using the Qualtrics v3 "Get Survey" API endpoint.


fetch_description(surveyID, elements = NULL, legacy = FALSE, ...)



A string. Unique ID for the survey you want to download. Returned as "id" by the all_surveys function.


A character vector. Lists elements of survey definition to be maintained. Possible elements are "metadata", "surveyoptions", "flow", "blocks", "questions", "responsesets", and/or "scoring" (case-insensitive). If legacy = TRUE, then possible elements are "metadata", "questions", "responsecounts", "blocks", "flow", "embedded_data", and/or "comments".


Logical. If TRUE, will use older Get Survey API endpoint via a call to legacy function metadata.


Additional options, only used when legacy = TRUE. User may pass an argument called questions, a vector containing the names of questions for which you want to return metadata.


If the request to the Qualtrics API made by this function fails, the request will be retried. If you see these failures on a 500 error (such as a 504 error) be patient while the request is retried; it will typically succeed on retrying. If you see other types of errors, retrying is unlikely to help.


A list containing survey description metadata. The contents of the returned list depend on elements.


## Not run: 
# Register your Qualtrics credentials if you haven't already
  api_key = "<YOUR-API-KEY>",
  base_url = "<YOUR-BASE-URL>"

# Retrieve a list of surveys
surveys <- all_surveys()

# Get description for a survey
descrip <- fetch_description(surveyID = surveys$id[6])

# Get metadata with specific elements
descrip_specific <- fetch_description(
  surveyID = id,
  elements = c("questions", "flow")

## End(Not run)

qualtRics documentation built on June 7, 2022, 1:06 a.m.