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

Getting incomplete data for intraday heart rate API

Hi,

We observed an issue with the Heart Rate Intraday API. There is a scheduler job running every hour to call the below intraday API with different dates:

 

https://api.fitbit.com/1/user/[user-id]/activities/heart/date/[date]/1d/1min.json

Once the API is called for a particular date, it will not be called again if it returns 200 response. We are storing the response on firestore in a similar format. For a past date, the response we got is not matching (the API response was 200) to what we have on the fitbit app for that particular date. On some other day, we tried to hit the API from postman with a new access token and we got the complete response.

 

The issue was observed mainly in the dataset field. Dataset is null for that particular date although other fields were showing some data so the response was definitely 200.

 

SunriseRun506_0-1663575701951.png

 

Thanks !

 

Best Answer
0 Votes
3 REPLIES 3

Hi @SunriseRun506 

 

The devices may not constantly sync every 15 minutes with the user's mobile device.  Having a scheduled job that runs every hour could mean you will get null responses from an endpoint.   My recommendation is to implement the Subscription APIs and query the HR data when you receive a notification for one of the data collections we support, such as activities.   See https://dev.fitbit.com/build/reference/web-api/developer-guide/using-subscriptions/.

 

Gordon

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

Thanks for the response @GordonFitbit.

 

We have already implemented the subscription model for a few APIs. But,, we need to collect some historical data for multiple past dates, so there we cannot use the subscriptions and we have to use a scheduler I believe. Null responses are fine, but the problem is with the partial data. In the image I have attached above, we have values in heart rate zones which is accurate and we have null for dataset. If we try to call it again through postman may be some hours later, we get the complete response with minute by minute values in dataset field.

 

We are trying to reproduce it again and will share more details to you on this.

 

Thanks

Best Answer
0 Votes

Hi @SunriseRun506 

 

If this is happening with historical data, then it could be a bug.   I would need a reproducible to provide to our engineering team.   Once you've reproduced the problem again, let me know.

 

Gordon

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