gs4_token: Produce configured token

View source: R/gs4_auth.R

gs4_tokenR Documentation

Produce configured token

Description

For internal use or for those programming around the Sheets 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, gs4_auth() is what they need. If there is no current token, gs4_auth() is called to either load from cache or initiate OAuth2.0 flow. If auth has been deactivated via gs4_deauth(), gs4_token() returns NULL.

Usage

gs4_token()

Value

A request object (an S3 class provided by httr).

See Also

Other low-level API functions: gs4_has_token(), request_generate(), request_make()

Examples


req <- request_generate(
  "sheets.spreadsheets.get",
  list(spreadsheetId = "abc"),
  token = gs4_token()
)
req


googlesheets4 documentation built on July 9, 2023, 7:40 p.m.