After creating a client in Nettskjema, this function will retrieve the access token needed for the remaining processes in the package. Automatically caches the token for more efficient API usage.
Usage
ns_auth_token(
client_id = Sys.getenv("NETTSKJEMA_CLIENT_ID"),
client_secret = Sys.getenv("NETTSKJEMA_CLIENT_SECRET"),
cache = TRUE,
cache_path = NULL
)
Arguments
- client_id
Character. Default assumes this is stored in .Renviron as "ns_CLIENT_ID"
- client_secret
Character. Default assumes this is stored in .Renviron as "ns_CLIENT_SECRET"
- cache
Logical. Should the token be cached?
- cache_path
Character. File path to where the token should be stored. Defaults to system cache directory.