06-16-2016 03:50
06-16-2016 03:50
Hello,
I am making an android app for a uni project and I need the heart rate details from fitbit.
Ideally I would need real/time heart rate data but I understand this is not possible (is this still the case?), so I'll need to work with the sync every 15-20min.
My question is, does the intraday data also sync every time the fitbit synchronises with the app, or is it only available once a day? Can I access the infraday data collected up to the moment when the last synchronization happened? And if so, how do I do it? (Should I write some specific information on the start-time and end-time fileds in the API request, or is just writing "today" in the date field enough?)
Thanks in advance for the help!
06-17-2016 11:20
06-17-2016 11:20
Hey @SaraBat, the data is available as soon as it syncs.
SaraBat wrote:Can I access the infraday data collected up to the moment when the last synchronization happened? And if so, how do I do it?
If you're just referring to data for the current day, then yes, "today" will give you data up until last sync.
Example:
https://api.fitbit.com/1/user/-/activities/heart/date/today/1d/15min.json
"activities-heart-intraday": {
"dataset": [
{
"time": "00:00:00",
"value": 65
},
{
"time": "00:15:00",
"value": 85
},
{
"time": "00:30:00",
"value": 91
},
{
[...]
},
{
"time": "09:30:00",
"value": 151
},
{
"time": "09:45:00",
"value": 114
}
],
"datasetInterval": 15,
"datasetType": "minute"
}
If no data was synced for "today", then "dataset" will be empty.