04-15-2020 17:15
04-15-2020 17:15
Hello Fitbit Community!
So, I'm building a personal project to track my weight loss journey, and may have found something unintentional.
I was trying to pull my heart rate back for a single day, in second intervals (knowing that it doesn't have to record this every second... but data is data.) and received data that wasn't what I was expecting.
GET 'https://api.fitbit.com/1/user/-/activities/heart/date/' + '2020-04-10' + '/1d/00:01.json'
The above returned a list of (public) activities.
That was when I noticed that I had mistyped the endpoint I was trying to hit, which is below.
'https://api.fitbit.com/1/user/-/activities/heart/date/' + '2020-04-10' + '/1d/1sec.json'
This endpoint did return the data I was expecting.
Should the previous request have failed for invalid resource?
04-20-2020 13:44
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.
04-20-2020 13:44
Hi @tormentz,
Thanks for reporting this.
This is actually a bug and a known issue. It appears that there are a few endpoints that will return the activities list instead of error code when there is a typo or bad syntax in the endpoint URL.
The only workaround at this time is to ensure that you are formatting your endpoint correctly.
I hope this helps. Let me know if you have any questions in the meantime.
Best Answer