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

Missing data for heart rate and sleep time intraday API response

Hi,

 

We have been troubleshooting an issue where a user of our application reports having data for both sleep time and heart rate for certain dates, as evidenced by screenshots in app:

image001.pngimage002.pngimage003.pngimage004.pngimage005.pngimage006.pngimage007.png

 

However from our end, we received an API response with missing data. These API responses were successful and show no signs of errors from our logs:

Heart rate:

successfulcalls.png

Sleep:

successfulcallssleep.png

 

For sleep log, the entire object with the `dateOfSleep` is missing from 2021-05-05 to 2021-05-13:

```

[{

"dateOfSleep": "2021-05-04",
...

},

{

"dateOfSleep": "2021-05-14",
...

}

]

```

And for heart rate log, the dataset is an empty array:

```

[

{

"date":"2021-05-06",
"activities-heart":[{"dateTime":"2021-05-06","value":{"customHeartRateZones":[],"heartRateZones":[{"caloriesOut":1265.904,"max":97,"min":30,"minutes":1440,"name":"Out of Range"},{"caloriesOut":0,"max":116,"min":97,"minutes":0,"name":"Fat Burn"},{"caloriesOut":0,"max":141,"min":116,"minutes":0,"name":"Cardio"},{"caloriesOut":0,"max":220,"min":141,"minutes":0,"name":"Peak"}]}}],
"activities-heart-intraday":{"dataset":[], ...}

},

...(same for 2021-05-06 till 2021-05-14),

{

"date":"2021-05-15",
"activities-heart":[{"dateTime":"2021-05-15","value":{"customHeartRateZones":[],"heartRateZones":[{"caloriesOut":1793.364,"max":99,"min":30,"minutes":1421,"name":"Out of Range"},{"caloriesOut":63.03147,"max":118,"min":99,"minutes":19,"name":"Fat Burn"},{"caloriesOut":0,"max":141,"min":118,"minutes":0,"name":"Cardio"},{"caloriesOut":0,"max":220,"min":141,"minutes":0,"name":"Peak"}],"restingHeartRate":61}}],
"activities-heart-intraday":{"dataset":[{"time":"00:00:00","value":56},

}

]

```

One thing we noted about the heart rate response is that "activities-heart" has an entry with caloriesOut and minutes ("caloriesOut":1265.904,"minutes":1440), yet it shows an empty dataset. Is this behavior expected? We would be expecting this to mean that there should be corresponding intraday data in dataset field based off those minutes.

 

We have also verified with the user that they have not changed their fitbit device during that time.

 

Thanks!

Best Answer
3 REPLIES 3

Hi @hi_SG 

 

Would you please explain the structure of the endpoints that you're executing?   The Fitbit endpoint is https://api.fitbit.com, but you're executing https://apim.hpb.cloud/prd/fitbit-server.   Also, was data not available through the API between 2021-05-04 through 2021-05-21, or are you still not receiving data for this user?

 

Also, would you please follow the steps in this section of the troubleshooting guide, https://dev.fitbit.com/build/reference/web-api/troubleshooting-guide/common-solutions/#Fitbit-user-h... to verify the user id in the mobile application is the same that you're querying?

 

Gordon

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

Hi @GordonFitbit 

Thanks for the reply.
Do kindly ignore the part on " https://apim.hpb.cloud/prd/fitbit-server". That is our application's proxy for our outgoing calls to Fitbit

Question (from you):
Was data not available through the API between 2021-05-04 through 2021-05-21, or are you still not receiving data for this user?

Answer:
Data was available through the API between 2021-05-04 through 2021-05-21 for all users, including the specified user (Fitbit ID 7XF762) whom which we are troubleshooting for.
However, the issue was that there was no heartrate intraday data (dataset is an empty array) and no sleep logs for this user, only for a date period (as listed above). We are able to successfully retrieve data for this user for dates before and after the specified date range. 

Progress
- We performed a re-sync (retrieving data from 2021-05-03 onwards for the user), and was able to successfully retrieve all the data subsequently. 

Root cause 
- We're still unsure why the previous calls to Fitbit returned empty data for the date range, a possibility could be that the participant might have linked with multiple devices during that period. 


Best Answer
0 Votes

I'm glad you were able to get the user's data.   I'm not aware of any long term outages during that period of time.  And, we don't store log data that far back.  It's possible the person was using different devices, but the devices only store data for about 6-7 days.   This person would have been using several devices.

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