Skip to contents

Use the Refresh Token generated to get a valid Access Token. Only the organization administrator account has the ability to generate API tokens.

Usage

get_access(`refreshToken`, `region` = "Americas")

Arguments

refreshToken

Use the Refresh Token generated from 'https://cloud.hawkindynamics.com/integrations'.

region

The region to define the URL to be used. Options: "Americas" (default), "Europe", "Asia/Pacific".

Value

A data frame with necessary information for accessing API (access token, token expiration, URL region). The contents of the data frame are stored in the system environment.

Details

Use this function to initiate access to your data in the cloud. All other hawkinR functions will depend on the values returned from this function.

When correct inputs are passed through the region and refreshToken parameters, the returned access token, expiration time, and regional URL will be stored in the system for use by other functions during this session.

The accessToken is set to expire every 60 minutes. If the token has expired, and you attempt to use a dependent function, you will be prompted to run this function again to receive a new access token.

Examples

if (FALSE) { # \dontrun{
# This is an example of how the function would be called with the region defaulting to "Americas".
# Replace 'refresh token' with an actual authentication token.

get_access('refreshToken')

# If you are in a different region and use one of the other URLs, declare your region by using the
#`region` parameter.

get_access('refreshToken', region = "Europe")
} # }