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.
ns_auth_token(
client_id = Sys.getenv("NETTSKJEMA_CLIENT_ID"),
client_secret = Sys.getenv("NETTSKJEMA_CLIENT_SECRET"),
cache = TRUE,
cache_path = NULL
)Character. Default assumes this is stored in .Renviron as "ns_CLIENT_ID"
Character. Default assumes this is stored in .Renviron as "ns_CLIENT_SECRET"
Logical. Should the token be cached?
Character. File path to where the token should be stored. Defaults to system cache directory.