Learn R Programming

googleAuthR (version 0.1.0)

gar_api_generator: googleAuthR data fetch function generator

Description

This function generates other functions for use with Google APIs

Usage

gar_api_generator(baseURI, http_header = c("GET", "POST", "PUT", "DELETE",
  "PATCH"), path_args = NULL, pars_args = NULL,
  data_parse_function = NULL)

Arguments

baseURI
The stem of the API call.
http_header
Type of http request.
path_args
A named list with name=folder in request URI, value=the function variable.
pars_args
A named list with name=parameter in request URI, value=the function variable.
data_parse_function
A function that takes a request response, parses it and returns the data you need.

path_args and pars_args add default values to the baseURI. You don't need to supply access_token for OAuth2 requests in pars_args, this

Value

  • A function that can fetch the Google API data you specify