03-26-2015 15:34
03-26-2015 15:34
Could someone from Fitbit API take a look at the following issue. Looks like Sleep in the Time Series is not returning correct values and the dashboard seems to be showing different information.
https://community.fitbit.com/t5/Fitbit-com-Dashboard/Bug-Total-Sleep-Discrepancy/m-p/722832/highligh...
Answered! Go to the Best Answer.
03-26-2015 16:43
03-26-2015 16:43
@FedericoArg wrote:We are using the Time-Series API which should get the aggregated values for the entire day.
https://wiki.fitbit.com/display/API/API-Get-Time-Series
No, it shouldn't. You will note on that page it says: "1. Note that sleep collection resources represent values for the main sleep entry for the dates in request (this is the log entry labeled with "isMainSleep" = true)."
So it specifically only includes the primary sleep session.
03-20-2015 15:14
03-20-2015 15:14
@FedericoArg wrote:I mainly asking this because I am seeing a Bug in the Fitbit API when returning this information.
215 / 60 = 3.58 hours which does not match with what I slept that day (6.32hours)
{
"sleep-minutesAsleep": [
{
"dateTime": "2015-03-18",
"value": "215"
}
]
}
What API call are you using? You should be using API-Get-Sleep and looking at the "summary" section, which shows the total of all sleep sessions for the day, which should look like:
"summary":{
03-26-2015 15:26
03-26-2015 15:26
We are using the Time-Series API which should get the aggregated values for the entire day.
https://wiki.fitbit.com/display/API/API-Get-Time-Series
sleep/minutesAsleep
sleep/awakeningsCount
sleep/minutesAwake
03-26-2015 16:43
03-26-2015 16:43
@FedericoArg wrote:We are using the Time-Series API which should get the aggregated values for the entire day.
https://wiki.fitbit.com/display/API/API-Get-Time-Series
No, it shouldn't. You will note on that page it says: "1. Note that sleep collection resources represent values for the main sleep entry for the dates in request (this is the log entry labeled with "isMainSleep" = true)."
So it specifically only includes the primary sleep session.
03-26-2015 16:51
03-26-2015 16:51
I combined your posts all in the API forum, where it is most appropriate. But again, if you look at the documentation, it appears to be working as intended.
03-27-2015 10:16
03-27-2015 10:16
Thank you for pointing that to me.
08-16-2015 20:56
08-16-2015 20:56
I don't see that caveat at https://dev.fitbit.com/docs/sleep/#get-sleep-time-series. Was that an intentional omission?