Skip to content

REDCap API Parameters

Shawn Garbett edited this page Jan 25, 2023 · 1 revision

Each API function accepts a set of parameters that may or may not be accessible via the redcapAPI package. This page lists all of the parameters for each API function, whether it is accessible to the R user, and the rationale for excluding it (if it was excluded).

Export Records

Available to the redcapAPI user

  • fields
  • forms
  • events
  • exportSurveyFields appears as the argument survey
  • exportDataAccessGroups appears as the argument dag
  • exportCheckboxLabels (Available only after REDCap 6.0)

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. exportRecords sets the content value to 'record'.
  • format. Since the intent is to return an analysis-ready data frame, this is always set to 'csv' as it is the easiest to read into a data frame within R.
  • type. Always set to flat for the convenience of converting to a data frame.
  • rawOrLabel. This option determines if the API returns coded or labeled data. The redcapAPI package always sets this to 'raw' and uses the data dictionary to internally convert data if requested with the labels argument in exportRecords.
  • eventName is always passed to the API as 'unique'. Consequently, in the data frame obtained, the field redcap_event_name will always give the unique event name. If you really wish to use the labeled event name, it may be obtained by merging with the events table obtained through exportEvents.
  • returnFormat is always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.

Import Records

Available to the redcapAPI user

  • overwriteBehavior
  • data
  • returnContent

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. exportRecords sets the content value to 'record'.
  • format. Since the intent is to return an analysis-ready data frame, this is always set to 'csv' as it is the easiest to read into a data frame within R.
  • type. Always set to flat for the convenience of converting to a data frame.
  • returnFormatis always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.

Export Reports (Available after REDCap 6.0)

Available to the redcapAPI user

  • report_id
  • exportCheckboxLabels

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. exportReports sets the content value to 'report'.
  • format. Since the intent is to return an analysis-ready data frame, this is always set to 'csv' as it is the easiest to read into a data frame within R.
  • returnFormatis always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.

Export Meta Data

Available to the redcapAPI user

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. exportMetaData sets the content value to 'metadata'.
  • format. Since the intent is to return an analysis-ready data frame, this is always set to 'csv' as it is the easiest to read into a data frame within R.
  • fields. This would allow the user to change the fields for which meta data is retrieved. By default, the redcapAPI package pulls the entire data dictionary.
  • forms. This would allow the user to change the forms for which meta data is retrieved. By default, the redcapAPI package pulls the entire data dictionary.
  • returnFormat is always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.

Export a File

Available to the redcapAPI user

  • record
  • field
  • event

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. exportFiles sets the content value to 'file'.
  • action. For file export, this is always set to 'export'.
  • returnFormatis always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.

Import a File

Available to the redcapAPI user

  • record
  • field
  • event
  • file

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. importFiles sets the content value to 'file'.
  • action. For file export, this is always set to 'import'.
  • returnFormatis always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.

Delete a File

Available to the redcapAPI user

  • record
  • field
  • event

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. deleteFiles sets the content value to 'file'.
  • action. For file export, this is always set to 'delete'.
  • returnFormatis always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.

Export Instruments

Available after REDCap 5.9.

Available to the redcapAPI user

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. exportInstruments sets the content value to 'instrument'.
  • format Since the intent is to return an analysis-ready data frame, this is always set to 'csv' as it is the easiest to read into a data frame within R.

Export Events

Available to the redcapAPI user

  • arms

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. exportEvents sets the content value to 'event'.
  • format Since the intent is to return an analysis-ready data frame, this is always set to 'csv' as it is the easiest to read into a data frame within R.
  • returnFormatis always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.

Export Arms

Available to the redcapAPI user

  • arms

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. exportArms sets the content value to 'arm'.
  • format Since the intent is to return an analysis-ready data frame, this is always set to 'csv' as it is the easiest to read into a data frame within R.
  • returnFormatis always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.

Export Form-Event Mappings

Available to the redcap user

  • arms

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. exportMappings sets the content value to 'formEventMapping'.
  • format Since the intent is to return an analysis-ready data frame, this is always set to 'csv' as it is the easiest to read into a data frame within R.
  • returnFormatis always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.

Export Users

Available to the redcapAPI user

Limited use by the redcapAPI user

  • token is provided to the API calls via a redcapConnection object. Thus, the user may not directly pass the token but must first alter the redcapConnection object in order to change the token.

Unavailable to the redcapAPI user

  • content. This option specifies the type of content returned (records, events, arms, files, etc). It is hard-coded within each function in redcapAPI to correspond with the desired output. exportUsers sets the content value to 'user'.
  • format Since the intent is to return an analysis-ready data frame, this is always set to 'csv' as it is the easiest to read into a data frame within R.
  • returnFormat is always set to 'csv'. This option governs how messages from the API are returned to R. The 'csv' option gives the most convenient format for displaying those messages to the R user.
Clone this wiki locally