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_req_auth(
req,
client_id = Sys.getenv("NETTSKJEMA_CLIENT_ID"),
client_secret = Sys.getenv("NETTSKJEMA_CLIENT_SECRET"),
client_name = "nettskjemar"
)
Arguments
- req
An httr2 request, usually
ns_req
- client_id
Character. Retrieved from the Client portal.
- client_secret
Character. Retrieved from the Client portal.
- client_name
Character. Used to identify who has been running the commands.