ns_auth_token: Retrieve access token

View source: R/ns-auth.R

ns_auth_tokenR Documentation

Retrieve access token

Description

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.


LCBC-UiO/nettskjemar documentation built on April 11, 2025, 11:01 p.m.