Fitbit Client API
Client library to call the Fitbit API using OAuth2.
Please note that this library doesn't provide any oauth2 method for Fitbit yet. Only provides refresh token functionality.
Each API method requires valid Fitbit API in the following format
-
access_token
: a valid user's access token. -
refresh_token
: the user's refresh token. -
expires_in
: Expiration time in SECONDS. -
expires_at
: Date time of expiration in ISODate format
Constructor.
Get user's profile based on his credentials
Get time series data based on user's scope and specified resource-path RequestObj is an object that contains resource-specific data that follow Fitbit spec in the following format :
-
resourcePath
: valid resource path. -
baseDate
: Range start date. Default value istoday
. -
endDate
: Range end date. -
period
: The range for which data will be returned. Default value is7d
. IfendDate
is specified,endDate
will be used instead of period.
Refreshing access token from users. Result will be token object with user_id and current API scope.
Each request required valid object in the following format as parameter
-
path
: resource path e.g.sleep/date/2015-10-10.json
-
userId
: Optional parameter. Default value is-
if not provided.
Get user's resource data based on provided options.
Post user's resource data based on provided options. Data is an optional parameter.
Put request of user's resource data based on provided options. Data is an optional parameter.
Delete user's resource data based on provided options. Data is an optional parameter.