Prompts the user to input a valid REDCap API token and stores it as an environment variable for the current R session.
Instead of using this function you should consider setting your token within your REnviron file which can be edited with edit_r_environ
.
Details
If a valid token already exists in the R session, the function notifies the user and asks whether they want to replace it. The user is guided to provide a new token through the console. It is strongly discouraged to include API tokens directly within R scripts. The token is validated internally and stored using `Sys.setenv()`.
See also
For the function to work you need to have a valid DB object from setup_DB()
.
See our REDCap Tokens Article
Other Token Functions:
test_REDCap_token()
,
view_REDCap_token()