06-05-2025 08:12
06-05-2025 08:12
Hello,
I recently had trouble with getting the intraday heartrate data for a client app. When i request the data from the browser, i get this reponse:
REQUEST:
```
GET /1/user/-/activities/heart/date/[YYYY-MM-DD]/1d/1min/time/00:00/23:59.json HTTP/1.1
Host: localhost:3000
Accept: application/json
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Referer: http://localhost:3000/dashboard
Authorization: Bearer [REDACTED]
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Priority: u=4
Pragma: no-cache
Cache-Control: no-cache
```
RESPONSE:
```<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
body
{
margin: 0;
overflow: hidden;
}
#mainFrame
{
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<!--rid=1239404970632530671-->
<form target="_top" id="mainForm">
<iframe id="mainFrame" src="https://www.fitbit.com/404" frameborder="0"></iframe>
</form>
</body>
</html>```
I am developping on localhost and using react proxy to make the request go to fitbit. Here is the package.json:
```
{
"version": "0.1.0",
"private": true,
"proxy": "https://api.fitbit.com/", <--------
"dependencies": {
...}
}
```
I don't have any problem with other request like activities by date (/1/user/-/activities/date/[YYYY-MM-DD].json) or hrv (/1/user/-/hrv/date/[YYYY-MM-DD].json).
I also have a similar problem with sleep data. I get an error this time. This makes my think the two are related because they would required more access to the api/i would not be authorized ?
RESPONSE FOR SLEEP:
{"errors":[{"errorType":"system","fieldName":"n/a","message":"Not Found"}],"success":false}
My app was approved for intraday access but I don't understand where theses errors come from. Is it related to the fitbit api or me ?