09-17-2024 18:04
09-17-2024 18:04
I'm trying to develop a prototype that integrates with the fitbit api, but I haven't been able to fetch any data that makes sense through the api.
Every call that i make, be it to fetch a specific date's stats (/1/user/[user-id]/activities/date/[date].json) or to get all time stats, it always returns me 0 for the step count and default values for the other fields. My app is correctly configured and I dont get authentication errors, I made sure that i'm using use the same user on my phone and on the app that i'm developing, but still I cant find a way to get anything from the api.
When calling /1/user/[user-id]/activities/date/[date].json to get my user's Get Lifetime Stats, this is the response:
{"lifetime":{"total":{"activeScore":-1,"caloriesOut":-1,"distance":0,"steps":0},"tracker":{"activeScore":-1,"caloriesOut":-1,"distance":0,"steps":0}}}
And on my phone, I have all my data synced to fitbit, I can go to any day and check, my step count is absolutely not 0, i have data synced to health connect, the user id on my phone is the same one I'm using to develop my app, everything should be working fine but i always get zeroes and default values.
when calling https://api.fitbit.com/1/user/-/activities/date/(year-month-day).json, i get the following response
{
"activities": [],
"summary": {
"caloriesOut": 1712,
"activityCalories": 0,
"caloriesBMR": 1769,
"activeScore": -1,
"steps": 0,
"sedentaryMinutes": 1440,
"lightlyActiveMinutes": 0,
"fairlyActiveMinutes": 0,
"veryActiveMinutes": 0,
"distances": [{
"activity": "total",
"distance": 0.0
}, {
"activity": "tracker",
"distance": 0.0
}, {
"activity": "sedentaryActive",
"distance": 0.0
}, {
"activity": "lightlyActive",
"distance": 0.0
}, {
"activity": "moderatelyActive",
"distance": 0.0
}, {
"activity": "veryActive",
"distance": 0.0
}, {
"activity": "loggedActivities",
"distance": 0.0
}],
"marginalCalories": 0,
"heartRateZones": []
},
"goals": {
"caloriesOut": 2546,
"steps": 10000,
"distance": 8.05,
"floors": 10,
"activeMinutes": 30
}
}
when I can see in the fitbit app, that I have quite a bit of activity that day.
Also, the data was synced from google fit, if it helps.
Is there anything that i'm doing wrong, or it's a known bug? I cant seem to figure it out.
09-18-2024 06:18
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
09-18-2024 06:18
Hi @suresure
Would you please provide me with your user id and your client ID? I'll take a look at the problem today and see if I can figure out what is wrong.
Best Answer11-08-2024 07:06
11-08-2024 07:06
Hi @Gordon-C - We are having the same issue where steps continue to show as zero even when user has steps. Is there a fix/solution from the above thread?
Thx.
Tom