Learn R Programming

redcapAPI (version 2.7.4)

exportUsers: Export the Users for a Project

Description

Retrieve a data frame giving the users, expiration dates, and data access privileges for each user.

Usage

exportUsers(rcon, ...)

# S3 method for redcapApiConnection exportUsers( rcon, dates = TRUE, labels = TRUE, form_rights = TRUE, ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

Value

Returns a data frame. The number of columns in the data frame will depend on your version of REDCap.

  • username User name

  • email The user's e-mail address

  • firstname The user's first name

  • lastname The user's last name

  • expiration The expiration date of the user's access to the project

  • data_access_group The data access group the user is assigned to

  • data_export The user's data export rights. 0=no access, 2=De-Identified, 1=Full Data Set

  • mobile_app (6.5.0+) Flag for if the user has permissions for the mobile application

  • mobile_app_download_data (6.5.0+) Flag for if the user may download data from the mobile app

The data frame will have one additional column for each form giving the user's form-level permissions in the project. 0=no access, 2=read only, 1=view records/responses and edit records (survey responses are read-only), 3 = edit survey responses

Arguments

rcon

A REDCap connection object as generated by redcapConnection.

...

Arguments to be passed to other methods.

dates

logical(1) Indicates if the expiration date is converted to a POSIXct object.

labels

logical(1) Indicates if the data export and form access rights are converted to factor objects.

form_rights

logical(1) Indicates if the form rights should be transformed to one column per form. The API-provided character string is always returned with the format [form_name]:[access_code] and a comma separating each form.

error_handling

An option for how to handle errors returned by the API. see redcap_error

config

list Additional configuration parameters to pass to POST. These are appended to any parameters in rcon$config.

api_param

list Additional API parameters to pass into the body of the API call. This provides users to execute calls with options that may not otherwise be supported by redcapAPI.

REDCap API Documentation (6.5.0)

This function allows you to export the users for a project

REDCap Version

5.8.2 (Perhaps earlier)

Known REDCap Limitations

None

Author

Benjamin Nutter

Details

For some reason I have yet to identify, some User Tables do not export correctly. In some situations, the fields are all shifted one column to the left and the form names are not always exported. This seems to be more common in projects still in Development mode. I have seen one instance of a project in Production where one user had one more column given than any other user. If you notice this behavior, please report it to me as it may help me narrow down the source of the problem

References

Please refer to your institution's API documentation.

Additional details on API parameters are found on the package wiki at https://github.com/vubiostat/redcapAPI/wiki/REDCap-API-Parameters