oauth: Authenticate

Description Usage Arguments Details Value Functions Examples

Description

Generate a Qualtrics token valid for an hour.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
qualtrics_auth(
  id = Sys.getenv("QUALTRICSINR_ID"),
  secret = Sys.getenv("QUALTRICSINR_SECRET"),
  data_center = Sys.getenv("QUALTRICSINR_DATA_CENTER"),
  cache = TRUE
)

load_oauth()

refresh_oauth()

set_qualtrics_opts(
  api_token = Sys.getenv("QUALTRICSINR_TOKEN"),
  data_center = Sys.getenv("QUALTRICSINR_DATA_CENTER")
)

Arguments

id, secret

Your client id and secret.

data_center

Your data center id, if NULL then the functions attempts to get it from set_qualtrics_opts.

cache

Whether to set the token as option (set_qualtrics_opts) and cache the results to file.

api_token

Your client id and generated token.

Details

Obtains a bearer token valid for an hour and saved it to the working directory in a hidden file named qualtrics-oauth. Note that this token will be automatically loaded in future sessions, and refreshed if needed.

Value

if cache is FALSE then returns an object of class quatrics_token.

Functions

Examples

1
2
3
4
5
6
7
8
## Not run: 
  # OAUth 2.0
  qualtrics_auth("xXxX0x0X0xxX0", "xXxX0x0X0xxX0", "data.center")

  # Set token and data_center options
  set_qualtrics_opts("xXxX0x0X0xxX0xXxX0x0X0xxX0", "myCenter.eu")

## End(Not run)

ppssphysics/QualtricsInR documentation built on Aug. 30, 2021, 8:12 a.m.