{"prod_token": {
"REDCap Project ID Goes Here": "API token for that project goes here",
"REDCap Project ID Goes Here": "API token for that project goes here"
},"dev_token": {
"REDCap Project ID Goes Here": "API token for that project goes here",
"REDCap Project ID Goes Here": "API token for that project goes here"
},"qa_token": {
"REDCap Project ID Goes Here": "API token for that project goes here",
"REDCap Project ID Goes Here": "API token for that project goes here"
} }
6 Storing API tokens
Before you can make any API calls to your REDCap project, you will need to generate an API token for that project. You can do so in the REDCap web application under the ‘API’ page of your project.
It is recommended to save your API tokens in a separate file on your local machine that is then called into your main script. That way you can share your script and push it to the GitHub without compromising your tokens. Tokens should be treated as secrets and should not be shared with others.
To follow along with this guide, you can save your tokens for each REDCap project as a json file with the following the format:
Note: You can create a json file in any text editor by saving your file with a ‘.json’ extention.