View source: R/GetFitOAuth2Token.R
Retrieves or refreshes an OAuth2 token. Two options must be set or provided as arguments:
RGoogleFit.client_id
RGoogleFit.client_secret
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.
1 2 | GetFitOauth2Token(client_id = NULL, client_secret = NULL,
scopes = NULL, use_oob = F, cache = T)
|
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. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.