List users authorized for a project.
redcap_users_export(
redcap_uri,
token,
verbose = TRUE,
config_options = NULL,
handle_httr = NULL
)
The uri/url of the REDCap server typically formatted as "https://server.org/apps/redcap/api/". Required.
The user-specific string that serves as the password for a project. Required.
A boolean value indicating if message
s should be printed
to the R console during the operation. The verbose output might contain
sensitive information (e.g. PHI), so turn this off if the output might
be visible somewhere public. Optional.
A list of options passed to httr::POST()
.
See details at httr::httr_options()
. Optional.
The value passed to the handle
parameter of
httr::POST()
.
This is useful for only unconventional authentication approaches. It
should be NULL
for most institutions. Optional.
data_user
: A tibble::tibble()
of all users associated with the project.
One row represents one user.
data_user_form
: A tibble::tibble()
of permissions for users and forms.
One row represents a unique user-by-form combination.
success
: A boolean value indicating if the operation was apparently
successful.
status_codes
: A collection of
http status codes,
separated by semicolons. There is one code for each batch attempted.
outcome_messages
: A collection of human readable strings indicating the
operations' semicolons. There is one code for each batch attempted. In an
unsuccessful operation, it should contain diagnostic information.
elapsed_seconds
: The duration of the function.
Documentation in REDCap 8.4.0
for a project,
This method allows you to export the list of users
including their user privileges and also email address, first name,
and last name.
: If the user has been assigned to a user role, it will return
Note's defined privileges. the user with the role
# \dontrun{
uri <- "https://bbmc.ouhsc.edu/redcap/api/"
token <- "06DEFB601F9B46847DAA9DF0CFA951B4"
result <- REDCapR::redcap_users_export(redcap_uri=uri, token=token)
#> The REDCap users were successfully exported in 0.2 seconds. The http status code was 200.
result$data_user
#> # A tibble: 2 × 32
#> username email firstname lastname expiration data_access_group
#> <chr> <chr> <chr> <chr> <date> <chr>
#> 1 unittestphifree wibeasley@hot… Unit Test PHI Free NA daga
#> 2 wbeasleya william-beasl… Will Beasley… NA NA
#> # ℹ 26 more variables: data_access_group_id <chr>, design <lgl>, alerts <dbl>,
#> # user_rights <lgl>, data_access_groups <lgl>, reports <lgl>,
#> # stats_and_charts <lgl>, manage_survey_participants <lgl>, calendar <lgl>,
#> # data_import_tool <lgl>, data_comparison_tool <lgl>, logging <lgl>,
#> # file_repository <lgl>, data_quality_create <lgl>,
#> # data_quality_execute <lgl>, api_export <lgl>, api_import <lgl>,
#> # mobile_app <lgl>, mobile_app_download_data <lgl>, record_create <lgl>, …
result$data_user_form
#> # A tibble: 2 × 4
#> username form_name permission_id permission
#> <chr> <chr> <int> <fct>
#> 1 unittestphifree demographics 1 edit_form
#> 2 wbeasleya NA NA unknown
# }