redcap_survey_link_export_oneshot {REDCapR}R Documentation

Download a file from a REDCap project record

Description

This function uses REDCap's API to download a file.

Usage

redcap_survey_link_export_oneshot(
  redcap_uri,
  token,
  record,
  instrument,
  event = "",
  verbose = TRUE,
  config_options = NULL
)

Arguments

redcap_uri

The URI (uniform resource identifier) of the REDCap project. Required.

token

The user-specific string that serves as the password for a project. Required.

record

The record ID where the file is to be imported. Required

instrument

The name of the instrument associated with the survey link. Required

event

The name of the event where the file is saved in REDCap. Optional

verbose

A boolean value indicating if messages should be printed to the R console during the operation. Optional.

config_options

A list of options to pass to httr::POST() method in the 'httr' package. See the details below. Optional.

Details

Currently, the function doesn't modify any variable types to conform to REDCap's supported variables. See validate_for_write() for a helper function that checks for some common important conflicts.

Permissions Required To use this method, you must have API Export privileges in the project. (As stated in the 9.0.0 documentation.)

Value

Currently, a list is returned with the following elements,

Author(s)

Will Beasley

References

The official documentation can be found on the 'API Help Page' and 'API Examples' pages on the REDCap wiki (i.e., https://community.projectredcap.org/articles/456/api-documentation.html and https://community.projectredcap.org/articles/462/api-examples.html). If you do not have an account for the wiki, please ask your campus REDCap administrator to send you the static material.

Examples

## Not run: 
uri     <- "https://bbmc.ouhsc.edu/redcap/api/"
token   <- "8FA9A6BDAE2C0B5DD3CB472DD8E8918C" #pid=817
record  <- 1
instrument   <- "participant_morale_questionnaire"
# event <- "" # only for longitudinal projects

result <- REDCapR::redcap_survey_link_export_oneshot(
  record         = record,
  instrument     = instrument,
  redcap_uri     = uri,
  token          = token
)
result$survey_link

## End(Not run)

[Package REDCapR version 1.1.0 Index]