Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FITBIT API gives zero as data on inactive days, where it has to discard the data.

I have integrated FITBT API into my application. Where based on the data collected through API I populate a graph.
In one use case, I have a user who was using the FITBIT till June 25th, so till the 25th of June, I have proper steps data for this user. Now the user was inactive with his device from the 25th till today and here the API gave me zero as data between the 25th and today whereas it should be null or an empty list for those days []. 
This is the same case for all other data types such as minutes_active, water, etc.
Is there a way to determine whether the user was inactive/not wearing the app during these days?

Best Answer
0 Votes
4 REPLIES 4

Hi @Dhivakhar 

 

Yes, there is a way to determine if the user is syncing, but it determined by the scope enabled by the user.   If the user has enabled the "settings" scope, then you can call the Get Devices endpoint.  This endpoint will return the last sync timestamp.  

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer

Hi, @Gordon-C thanks for your prompt reply.

  1. I have one concern about using the last_synced_date. 
  2. Consider this scenario where the user has an inactive device from date_a to date_b.
  3. Here, the last synced date would be date_a. So I can query data from API till the date_a which would give proper data as the user has been using the device.
  4. Now, once the user sync's the data back again on the date_b the last synced date would be date_b and now if I request data till date_b the data in between would still show as zero.

We have an account where there is no device paired and when we query any data say steps in this account we get zero as the value for all those dates.

Best Answer
0 Votes

Hi Dhivakhar,

 

It's possible some of the endpoints were designed to return zero as not having data because the user was inactive.  I can submit enhancements to change the behavior to return a null instead.   I cannot guarantee the request would be implemented as it could cause a breaking change for hundreds of existing applications.

 

The Web API does support subscriptions for several data collections.  The subscriptions will send your application a webhook notification to let you know when there is new data to download.  However, you will come across the same situation reconciling data between date_a and date_b.

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer

Thanks, @Gordon-C ,

Currently, we have implemented this method where we are checking if all data points collected within that day are zero. We mark that day as inactive and ignore that data. As resting_heart_rate will never become ZERO. 

Best Answer
0 Votes