odc_set_key() stores your Open Data Communities username and API key
as an environment variable (ODC_API_KEY) for use in all subsequent API calls.
The credentials are combined and encoded in Base64 as required for the API's
HTTP Basic Authentication.
Arguments
- odc_user
characterYour Open Data Communities username (usually your email address). IfNULL, the function will abort.- odc_key
characterYour Open Data Communities API key. IfNULL, the function will abort.- overwrite
logicalIfTRUE, will overwrite an existingODC_API_KEYenvironment variable. Defaults toFALSE, preventing accidental overwrites.
Details
This function only needs to be run once per R session, or whenever your
credentials change. The key is stored in the ODC_API_KEY environment
variable for the current session.
For security, it is recommended not to hard-code credentials in your scripts. Consider using this function interactively or sourcing it from a secure location.
