REDCap API Parameters - vubiostat/redcapAPI GitHub Wiki
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
- Import Records
- Export Reports
- Export Metadata (i.e. Data Dictionary)
- Export a File
- Import a File
- Delete a File
- Export Instruments
- Export Events
- Export Arms
- Export Form-Event Mappings
- Export Users
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
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.exportRecordssets 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
redcapAPIpackage always sets this to 'raw' and uses the data dictionary to internally convert data if requested with thelabelsargument inexportRecords. - eventName is always passed to the API as 'unique'. Consequently, in the data frame obtained, the field
redcap_event_namewill 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 throughexportEvents. - 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 theRuser.
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
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.exportRecordssets 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 theRuser.
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
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.exportReportssets 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 theRuser.
Export Meta Data
Available to the redcapAPI user
Limited use by the redcapAPI user
- token is provided to the API calls via a
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.exportMetaDatasets 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
redcapAPIpackage pulls the entire data dictionary. - forms. This would allow the user to change the forms for which meta data is retrieved. By default, the
redcapAPIpackage 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 theRuser.
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
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.exportFilessets 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 theRuser.
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
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.importFilessets 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 theRuser.
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
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.deleteFilessets 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 theRuser.
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
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.exportInstrumentssets 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
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.exportEventssets 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 theRuser.
Export Arms
Available to the redcapAPI user
- arms
Limited use by the redcapAPI user
- token is provided to the API calls via a
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.exportArmssets 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 theRuser.
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
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.exportMappingssets 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 theRuser.
Export Users
Available to the redcapAPI user
Limited use by the redcapAPI user
- token is provided to the API calls via a
redcapConnectionobject. Thus, the user may not directly pass the token but must first alter theredcapConnectionobject 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
redcapAPIto correspond with the desired output.exportUserssets 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 theRuser.