GetFitOauth2Token: GetFitOauth2Token

Description Usage Arguments

View source: R/GetFitOAuth2Token.R

Description

Retrieves or refreshes an OAuth2 token. Two options must be set or provided as arguments:

Requires setup of API Credentials. A good tutorial for setting up Google REST API credentials can be found here: [How to authenticate using OAuth2 through R](https://biolitika.si/how-to-authenticate-using-oauth2-through-r.html). Simply do these steps for the Google Fitness API.

Usage

1
2
GetFitOauth2Token(client_id = NULL, client_secret = NULL,
  scopes = NULL, use_oob = F, cache = T)

Arguments

client_id

Client ID from console.developers.google.com

client_secret

Client Secret from console.developers.google.com

scopes

Scopes required for requests. List of scopes available on the [Google Fitness REST API Documentation](https://developers.google.com/fit/rest/v1/authorization)

use_oob

if FALSE (the default), use a local webserver (http://localhost/) for the OAuth dance. Otherwise, provide a URL to the user and prompt for a validation code

cache

A logical value or a string. TRUE (the default) means to cache using the default cache file .httr-oauth, FALSE means don't cache, and NA means to guess using some sensible heuristics. A string means use the specified path as the cache file.


yogat3ch/RGoogleFit documentation built on Nov. 5, 2019, 1:20 p.m.