02-16-2021 08:53
02-16-2021 08:53
How far back can I request sleep data of a user, through the Rest API?
Answered! Go to the Best Answer.
02-17-2021 15:20
02-17-2021 15:20
Hi @onesimo,
Welcome to the forums!
When testing the sleep logs by date range endpoint with a date range of 2017-01-01 to 2021-01-01, I get the following error:
{
"errors": [
{
"errorType": "validation",
"fieldName": "endDate",
"message": "Max date range is 100 days"
}
]
I hope this helps!
02-17-2021 15:20
02-17-2021 15:20
Hi @onesimo,
Welcome to the forums!
When testing the sleep logs by date range endpoint with a date range of 2017-01-01 to 2021-01-01, I get the following error:
{
"errors": [
{
"errorType": "validation",
"fieldName": "endDate",
"message": "Max date range is 100 days"
}
]
I hope this helps!
03-23-2021 06:31
03-23-2021 06:31
Thank you
03-23-2021 17:39
03-23-2021 17:39
The range can be up to 100 days, but you can request data for a "practically" unlimited period in the past. There is a date when the user joined FitBit(you can get that date in the prile endpoint), and since then there is a possibility to receive data. However, if you request for a period before that date, you will not get an error, but rather an empty result set.