get_iform_access_token: Request an access_token

Description Usage Arguments Details Value Examples

View source: R/access_token.R

Description

Sends a request to iFormBuilder for an access_token. This is needed in order to authorize communication with the iFormBuilder API. If you do not have a dedicated server then replace server_name with app.

Usage

1
get_iform_access_token(server_name, client_key_name, client_secret_name)

Arguments

server_name

The server name as encoded in the url: for example: 'https//server_name.iformbuilder.com'

client_key_name

The name given to the client_key in your .Renviron file

client_secret_name

The name given to the client_secret in your .Renviron file

Details

For client_key_name use the name you assigned to the client_key in your .Renviron file. For client_secret_name use the name you assigned to the client_secret in your .Renviron file. The client_key_name and client_secret_name, along with their respective values must be in your .Renviron file. This function will not work otherwise. Please see the README file at https://github.com/arestrom/iformr for additional information. Three tries will be attempted to retrive the token. If all attempts fail, a warning will be displayed indicating HTTP status.

Value

An access_token that expires after ten minutes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
# Get access_token, assuming you do not have a dedicated server
# Edit client_key and client_secret arguments as needed.
access_token <- get_iform_access_token(
  server_name = "app",
  client_key_name = "your_client_key_name",
  client_secret_name = "your_client_secret_name")

## End(Not run)

## Not run: 
# Get access_token, assuming your dedicated server is "wdfw"
access_token <- get_iform_access_token(
  server_name = "wdfw",
  client_key_name = "your_client_key_name",
  client_secret_name = "your_client_secret_name")

## End(Not run)

arestrom/iformr documentation built on Nov. 25, 2021, 11:21 p.m.