06-21-2021
11:02
- last edited on
06-23-2021
16:25
by
JohnFitbit
06-21-2021
11:02
- last edited on
06-23-2021
16:25
by
JohnFitbit
As of 6/16/2021 my host stopped getting sleep data. We request sleep as follows:
REQ:Method: GET, RequestUri: 'https://api.fitbit.com/1/user/-/sleep/date/2021-03-03.json', Version: 1.1, Content: <null>, Headers:
{
Authorization: Bearer <REDACTED>
}
but the returned content is:
RSP: StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Origin
Vary: Accept-Encoding
Fitbit-Rate-Limit-Limit: 150
Fitbit-Rate-Limit-Remaining: 125
Fitbit-Rate-Limit-Reset: 571
X-Frame-Options: SAMEORIGIN
CF-Cache-Status: DYNAMIC
cf-request-id: 0acfca85b60000930ae13ea000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
CF-RAY: 662cad1c5efd930a-SJC
Cache-Control: no-cache, private
Date: Mon, 21 Jun 2021 10:50:29 GMT
Server: cloudflare
Via: 1.1 google
Content-Language: en
Content-Type: application/json; charset=UTF-8
}
*************** RSP content: {"sleep":[],"summary":{"totalMinutesAsleep":0,"totalSleepRecords":0,"totalTimeInBed":0}}
The code for this area of our application hasn't been changed in years and was working fine up to 6/16/2021, although I'll be continuing to do isolated testing.
06-28-2021 06:37
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
06-28-2021 06:37
Hi @Kevin_H
You're using a deprecated version of the Sleep API. The current version is 1.2. Please try this endpoint to see if the sleep data is returned.
https://api.fitbit.com/1.2/user/-/sleep/date/2021-03-03.json
Best Answer06-28-2021 09:46
06-28-2021 09:46
Best Answer06-30-2021 14:57
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
06-30-2021 14:57
Hi @Kevin_H
The devices store about 6-7 days of data. I'd recommend reducing your throttle to maybe 4-5 days.
Gordon
Best Answer06-30-2021 17:04
06-30-2021 17:04
Best Answer