07-14-2022 00:03
07-14-2022 00:03
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?
07-14-2022 07:12
07-14-2022 07:12
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
07-15-2022 02:02
07-15-2022 02:02
Hi, @Gordon-C thanks for your prompt reply.
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.
07-19-2022 12:40
07-19-2022 12:40
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.
07-19-2022 23:02
07-19-2022 23:02
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.