01-14-2022 03:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-14-2022 03:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
We call a number of the Web Api endpoints and our code is assuming that the response will always be JSON that is serialisable into a very specfic format.
99.9% of the time that is correct, for example, calls to the"Get Activity Tracker Resource by Date Range Time Series" api endpoint below get us an array of Date and Calories.
https://api.fitbit.com/1/user/-/activities/tracker/calories/date/{0}/{1}.json?CacheBuster={2}
However sometimes the deserialisation of the JSON response fails and our app is not handling that well at all. I assume that sometimes the response from that endpoint could be a completely different JSON format such as if there is an issue with the user's data or acccount.
Where is the documentation for the different response formats?
Thanks

01-14-2022 13:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-14-2022 13:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @MunkiiYebee
The documentation for the endpoint that you're calling is https://dev.fitbit.com/build/reference/web-api/activity-timeseries/get-activity-timeseries-by-date-r.... We provide a sample response on the page.
May I ask where did you get information that we support the query parameter "CacheBuster"? I'm not aware that we support that query parameter.
Gordon
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

01-18-2022 01:04
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-18-2022 01:04
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Thanks @Gordon-C .
I know about the success response and that's what we are expecting when the requests succeeds. What I don't iknow is what for the body will be when it is not a HTTP 200 success.
Do you have an error message format?
May I ask where did you get information that we support the query parameter "CacheBuster"? I'm not aware that we support that query parameter.
This coding was done before I was on the project. Maybe it is to bust some client side cache in our libraries
Thanks
01-27-2022 07:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-27-2022 07:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
See if https://dev.fitbit.com/build/reference/web-api/troubleshooting-guide/error-handling/ gives you the information you need. I would remove the CacheBuster parameters. It could be causing issues on our side.
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

01-27-2022 07:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-27-2022 07:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Sent from Outlook

