Description Usage Arguments Details Value Examples
This function generates the fitbit token and performs the required API authorization.
1 2 | get_fitbit_token(file_path = "~/.fitbitr", appname = NULL, key = NULL,
secret = NULL, scope = c("activity", "heartrate", "sleep", "weight"))
|
file_path |
Character scalar; Path to the credentials file described in details. Leave the arguments key, secret and scope set to NULL if you want to use the credentials file for the authentication. |
appname |
Character scalar; Fitbit application name. |
key |
Character scalar; Fitbit OAuth 2.0 Client ID. |
secret |
Character scalar; Fitbit Client (Consumer) Secret. |
scope |
Character vector; API permission scope. Leave the defaults in order to access
all the features listed in |
Request rate limit information is stored in the fitbit token as the "rate_limit" attribute. It gets updated every time fitbit_GET is called.
Example credentials file (3 rows: appname, key, secret):
1 2 3 | GetMyData
14C889
apaojsdpoj213412p4j115j1p5oj21p5o
|
Fitbit token providing the access to your Fitbit account data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
## If the credentials file is located in "~/.fitbitr" just run:
fitbit_token <- get_fitbit_token()
## Else, specify the new credentials file location:
fitbit_token <- get_fitbit_token(file_path = "~/.custom_fitbitr")
## or enter the credentials as arguments:
fitbit_token <- get_fitbit_token(appname = "GetMyData",
key = "14C889",
secret = "apaojsdpoj213412p4j115j1p5oj21p5o"
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.