Learn R Programming

googlesheets4 (version 0.1.0)

sheets_token: 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, sheets_auth() is what they need. If there is no current token, sheets_auth() is called to either load from cache or initiate OAuth2.0 flow. If auth has been deactivated via sheets_deauth(), sheets_token() returns NULL.

Usage

sheets_token()

Arguments

Value

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

See Also

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

Examples

Run this code
# NOT RUN {
if (sheets_has_token()) {
  req <- request_generate(
    "sheets.spreadsheets.get",
    list(spreadsheetId = "abc"),
    token = sheets_token()
  )
  req
}
# }

Run the code above in your browser using DataLab