It is the main fonction to use for accessing RTE Data API. It will request an access token for the current session if none currently exists and be valid.
datarte_auth(token = NULL, client_id = NULL, client_secret = NULL, cache = FALSE)
token | optional argument. it exists to supply manually a token.
|
---|---|
client_id | character. the client id for the app. default |
client_secret | character. the client secret for the app. default
|
cache | logical or a string. |
invisibly the Token
which is saved for the current session,
and will be used when needed.
You can configure your R session to use always some client and secret by
setting RTE_API_CLIENT
and RTE_API_SECRET
environment variable
with base::Sys.setenv()
This function is inspired by googlesheet
package and its Oauth2 system.
# NOT RUN { client_id <- "cliend_id" client_secret <- "client_secret" datarte_auth(client_id = client_id, client_secret = client_secret, cache = F) # }