Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gar_token

Produce configured token


Description

For internal use or for those programming around the Google API. Returns a token pre-processed with [httr::config()]. Most users do not need to handle tokens "by hand" or, even if they need some control, [gar_auth()] is what they need. If there is no current token, [gar_auth()] is called to either load from cache or initiate OAuth2.0 flow. If auth has been deactivated via [gar_deauth()], 'gar_token()' returns 'NULL'.

Usage

gar_token()

Value

A 'request' object (an S3 class provided by [httr][httr::httr]).

See Also

Other low-level API functions: gar_has_token()

Examples

## Not run: 
req <- request_generate(
  "drive.files.get",
  list(fileId = "abc"),
  token = gar_token()
)
req

## End(Not run)

googleAuthR

Authenticate and Create Google APIs

v1.4.0
MIT + file LICENSE
Authors
Mark Edmondson [aut, cre] (<https://orcid.org/0000-0002-8434-3881>), Jennifer Bryan [ctb], Johann deBoer [ctb], Neal Richardson [ctb], David Kulp [ctb], Joe Cheng [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.