01-13-2022 23:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-13-2022 23:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi everyone. I've built an app integrated with Fitbit API, almost everything working fine, but there is a confusing issue.
User about whom i'm going to tell is the only one who use Sense Fitbit device. User has passed Fitbit authorization flow associated with my app and provided all required scope (sleep, activity). User can see activity and sleep statistics on his Fitbit profile, but API doesn't return any meaningful information.
So the question is: what can be done wrong? Possibly I'm using incorrect API version.
01-14-2022 13:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-14-2022 13:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm going to need a little more information to determine what the problem might be. Would you please send me the exact API calls you're executing for activity and sleep? Also, what type of response are you getting from the endpoints and what do you expect?
Gordon
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

01-16-2022 23:06
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-16-2022 23:06
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm using
https://api.fitbit.com/1.2/user/-/sleep/date/2022-01-10.json
for sleep statistics and
https://api.fitbit.com/2/user/-/activities/date/2022-01-10.json
for activities statistics.
Json I receive
{
"activities": [],
"goals": {
"activeMinutes": 30,
"caloriesOut": 1945,
"distance": 5,
"steps": 10000
},
"summary": {
"activeScore": -1,
"activityCalories": 0,
"caloriesBMR": 1117,
"caloriesOut": 1117,
"distances": [
{
"activity": "total",
"distance": 0
},
{
"activity": "tracker",
"distance": 0
},
{
"activity": "loggedActivities",
"distance": 0
},
{
"activity": "veryActive",
"distance": 0
},
{
"activity": "moderatelyActive",
"distance": 0
},
{
"activity": "lightlyActive",
"distance": 0
},
{
"activity": "sedentaryActive",
"distance": 0
}
],
"fairlyActiveMinutes": 0,
"lightlyActiveMinutes": 0,
"marginalCalories": 0,
"sedentaryMinutes": 1440,
"steps": 0,
"veryActiveMinutes": 0
}
}
But for current user I've expected at least
{
"activities": [],
"goals": {
"activeMinutes": 30,
"caloriesOut": 1945,
"distance": 5,
"steps": 10000
},
"summary": {
"activeScore": -1,
"activityCalories": 0,
"caloriesBMR": 1117,
"caloriesOut": 1117,
"distances": [
{
"activity": "total",
"distance": 2.73
},
{
"activity": "tracker",
"distance": 0
},
{
"activity": "loggedActivities",
"distance": 0
},
{
"activity": "veryActive",
"distance": 0
},
{
"activity": "moderatelyActive",
"distance": 0
},
{
"activity": "lightlyActive",
"distance": 0
},
{
"activity": "sedentaryActive",
"distance": 0
}
],
"fairlyActiveMinutes": 0,
"lightlyActiveMinutes": 0,
"marginalCalories": 0,
"sedentaryMinutes": 1440,
"steps": 6546,
"veryActiveMinutes": 0
}
}

01-27-2022 07:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-27-2022 07:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
This is probably a typo when posting your questions, but double-check you're using version 1 of the activity endpoint. You posted version 2.
Would you please verify the user id and client ID in the access token that you're using? The access token is a JWT token, so you should be able to see the contents. Sometimes during testing, people get mixed up with the user id that contains the data verses the user id that are querying in their application. You can verify the user id in the app by following the instructions here: https://dev.fitbit.com/build/reference/web-api/troubleshooting-guide/common-solutions/#Data-Synchoni.... Once you get the user id in the app, you can match it to the one in the access token.
Gordon
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

