get_token: Gets the internal token

Description Usage Value

Description

When configured properly, the package keeps a memory of the token and its expiry date and time for wrapper functions to use and to prevent requesting new tokens too frequently. The get_token function first searches the package environment for a token then proceeds to search for a cached token file. If a token cannot be found in either of these places, a new token is requested from the Lufthansa API using the user's credentials.

The token in the package environment only lasts during an R session. To use the same token between R sessions, the token and its expiry can be cached using the option options(lufthansar_token_cache = TRUE). The cached token is stored in a file called '.lufthansa-token' in the current working directory. Care must be taken to prevent the file from making the file public. For example, by adding it to a '.gitignore' file.

Usage

1

Value

The token as a string


peter0083/LufthansaR documentation built on May 21, 2019, 12:05 p.m.