11-25-2016 05:07 - edited 11-25-2016 05:15
11-25-2016 05:07 - edited 11-25-2016 05:15
Hi Fitbit,
Is this an expected return?
As followed by your docs:
Resource URLsThere are four acceptable formats for retrieving time series data:GET https://api.fitbit.com/1/user/-/activities/heart/date/[date]/[end-date]/[detail-level].json
URL (tried many different time frames, today returns time frame error):
GET https://api.fitbit.com/1/user/-/activities/heart/date/2016-11-11/2016-11-11/1sec.json
Returns:
{
"categories": [
{
"activities": [
{
"accessLevel": "PUBLIC",
"activityLevels": [
{
"id": 3016,
"maxSpeedMPH": -1,
"mets": 8.5,
"minSpeedMPH": -1,
"name": "6 - 8 inch step"
},
{
"id": 3017,
"maxSpeedMPH": -1,
"mets": 10,
"minSpeedMPH": -1,
"name": "10 - 12 inch step"
}
],
"hasSpeed": false,
"id": 90004,
"name": "Aerobic step"
},
{
"accessLevel": "PUBLIC",
"hasSpeed": false,
"id": 3015,
"mets": 6.5,
"name": "Aerobic, general"
},
{
"accessLevel": "PUBLIC",
"activityLevels": [
{
"id": 3020,
"maxSpeedMPH": -1,
"mets": 5,
"minSpeedMPH": -1,
"name": "low impact"
},
{
"id": 3021,
"maxSpeedMPH": -1,
"mets": 7,
"minSpeedMPH": -1,
"name": "high impact"
}
],
"hasSpeed": false,
"id": 90005,
"name": "Aerobics"
},
{
"accessLevel": "PUBLIC",
"hasSpeed": false,
"id": 3050,
"mets": 5.5,
"name": "Anishinaabe Jingle Dancing or other traditional American Indian dancing"
},
11-26-2016 12:12 - edited 11-26-2016 12:14
11-26-2016 12:12 - edited 11-26-2016 12:14
@Pimmoz That's not an expected response. If you're trying to get a specific date, you should go with the format:
https://api.fitbit.com/1/user/-/activities/heart/date/[date]/1d/[detail-level].json
If you're trying to get a range you could do something like this:
https://api.fitbit.com/1/user/-/activities/heart/date/[start-date]/[end-date]/1min.json
You can leave off the "/1min", "1sec" doesn't seem to work, but either way, a range will only give you the minutes spent in the HR zones and the resting HR for those days, it won't give minute/second detail level data.