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

Problems with intraday data on a date range

Hai There, 

 

We have just started integrating fitbit api's to our application, we got approved for intraday request and start using the api mentioned here https://dev.fitbit.com/build/reference/web-api/intraday/get-heartrate-intraday-by-date-range/ to get steps, floors and heart.

There are some things we observed and wanted to reach out for help.

 

1. we query the api for example /1/user/-/activities/heart/date/2022-05-31/2022-06-01/15m/time/21:09/11:13.json ( thinking the range will be 2022-05-31 21:09:00 to 2022-06-01 11:13:00) which is less than 24 hours. the response `activities-steps-intraday -> dataset` array has only `time` and `value` properties and `'activities-steps': [{'dateTime': '2022-05-31', 'value': '0'}]` only mentions start date how can we determine which date this value belongs to ? 

if the api does not support querying on multiple dates (even if the diff is < 24hrs) how we do a "backfill" or query after a certain timestamp, based on last synced timestamps ?

 

2. What we observed is the `time` and `value` pair is not always same, next time we hit the api what i mean is when we call the api with start_time as `15:00` the `activities-heart-intraday -> dataset`'s values starts at 15:00 and increments by 15min (mentioned interval) next time we try to get from `15:01` it starts from `15:01` this makes us storing data hard because we don't have actual timestamps of when the data is recorded.

 

3. we observe `{'errors': [{'errorType': 'validation', 'fieldName': 'resource path', 'message': 'Invalid time series resource path: /activities/floors'}]}` this error almost every time  and from other thread i've read this is because if user does not data for that activity or the devices user has doesn't support tracking the activity is this true ?

4. when we query sleep using this api https://dev.fitbit.com/build/reference/web-api/sleep/get-sleep-log-by-date-range/ even tho the sleep record is found in the fitibit application for the range, it always returns [].

 

These are all the observations/doubts using the api, we are interested in getting sleep, steps, floors, heart rate, swimming and cycling data accurate from the api to our system. 

 

Please let us know if we are missing something or there are workarounds past this.

 

Thanks in advance.

 

Best Answer
0 Votes
1 REPLY 1

I'm in this same situation. 

 

Right now, before querying the API, I consult the web api explorer  to make sure that calls I am making are valid. This may help you remove some erroneous calls. 

 

As per (1), that is bummer but my current code simply plots this data and it does not have issue. We may have to manually check the time and dates and create the datetime element. We know the start date and time so once we go over the 23:59 then next time is the next day date. It's a pain but not that bad. 

Best Answer
0 Votes