ns_req_auth: Authenticate Nettskjema request

View source: R/ns-auth.R

ns_req_authR Documentation

Authenticate Nettskjema request

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_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.


nettskjemar documentation built on June 8, 2025, 10:20 a.m.