10-30-2025 15:24
10-30-2025 15:24
I've been working with the web api for the last couple of days. Sending requests using an http client (like insomnia) was fine, but from within a web based application, the request fails with a CORS error.
Taking a look into the devtools showed an error for the preflight request, the browser performs. The OPTIONS request does not include the authorization header, which seems to be required for the endpoint I'm trying to call (/1.2/user/[user-id]/sleep/date/[date].json).
To be sure that the issue is not on my side, I checked the fitbit hosted swagger UI and was met with the same error.
Is this intended behaviour? If it is the case, as far as I can tell, the API would be rendered unusable from the browser directly.
Best Answer10-31-2025 06:46 - edited 10-31-2025 06:48
10-31-2025 06:46 - edited 10-31-2025 06:48
Today I checked if other endpoints are affected by this issue. At least the heartrate endpoint works as expected, possibly others. It might be limited to sleep data
Best Answer10-31-2025 11:57
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
10-31-2025 11:57
(Moved to Web API forum section.)
Best Answer