generate_fitbitr_token | R Documentation |
Performs the OAuth 2.0 dance to create a token to use with the Fitbit API.
generate_fitbitr_token(
app_name = "fitbitr",
client_id = Sys.getenv("FITBIT_CLIENT_ID"),
client_secret = Sys.getenv("FITBIT_CLIENT_SECRET"),
callback = Sys.getenv("FITBIT_CALLBACK", "https://localhost:1410/"),
scope = c("activity", "cardio_fitness", "electrocardiogram", "heartrate", "location",
"nutrition", "oxygen_saturation", "profile", "respiratory_rate", "settings", "sleep",
"social", "temperature", "weight"),
cache = TRUE,
use_basic_auth = TRUE,
...
)
app_name |
The name of your OAuth app. Default: |
client_id |
Your Fitbit client ID |
client_secret |
Your Fitbit client secret |
callback |
Your Fitbit redirect URL |
scope |
The scopes to enable |
cache |
Do you want to cache your token? See oauth2.0_token for details |
use_basic_auth |
A boolean for whether or not to use basic auth in oauth2.0_token. Defaults to |
... |
additional arguments to be passed to oauth2.0_token |
Saves a token as .fitbitr_token
which can then be used in the
background to authorize requests
Returns an OAuth 2.0 token (invisibly) that can be used to authorize requests to the Fitbit API. Also saves the token to .fitbitr_token
.
## Not run:
generate_fitbitr_token(
client_id = <YOUR-CLIENT-ID>
client_secret = <YOUR-CLIENT-SECRET>,
cache = TRUE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.