05-09-2019 12:22 - edited 05-09-2019 12:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-09-2019 12:22 - edited 05-09-2019 12:23
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello,
I want to fetch the Activity data as shown in https://dev.fitbit.com/build/reference/web-api/activity/
first example.
What I get with that ToFullUrl("/1/user/-/activities/date/{0}.json", ToFitbitFormat(activityDate));
is just the summary even tough I made some Activites like runnning etc. I can see them in the Fitbit App,
how can I get them from the FitbitAPI?
Thanks in advance
Answered! Go to the Best Answer.
Accepted Solutions
05-14-2019 09:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



05-14-2019 09:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @DeniOcean
The 400 Error in your first API call is correct. The Get Activities List endpoint does have required query parameters that you need to add. Those are beforeDate or afterDate, sort, limit and offset. We have the information documented here: https://dev.fitbit.com/build/reference/web-api/activity/#get-activity-logs-list.
If you return the error message body, we should be providing you with a hint to the error.
I'm not sure if the other 2 examples contain a typo in your code or the forum post, but I see you misspelled "afterDate" as "afterData". Correcting that spelling error allows me to execute the last example successfully, https://api.fitbit.com/1/user/-/activities/list.json?afterData=2019-05-10&sort=desc&offset=3&limit=1...
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

05-09-2019 16:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



05-09-2019 16:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @DeniOcean
Manually or tracker recorded activities should appear in the /1/user/-/activities/date/<date>.json endpoint. Auto-detected activities will not appear here. However, you can see all manually, tracker and auto-detected activities in the Get Activities List endpoint, https://api.fitbit.com/1/user/-/activities/list.json
Gordon
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

05-10-2019 00:41 - edited 05-10-2019 00:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-10-2019 00:41 - edited 05-10-2019 00:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello @Gordon-C
thanks for your reply. So I m calling exatly the url (https://api.fitbit.com/1/user/-/activities/list.json) you showed and I getting a
"The remote server returned an error: (400) Bad Request" back. But with the other command
I ll get an answer but without any activities in.
Thanks

05-13-2019 15:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



05-13-2019 15:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @DeniOcean
Are you providing any of the query parameters with the API call? They are documented here: https://dev.fitbit.com/build/reference/web-api/activity/#get-activity-logs-list. If so, please provide the complete URL you're executing.
Also, you could try executing the endpoint using the Web API Explorer, https://dev.fitbit.com/build/reference/web-api/explore/. If you get it to work there, copy/paste the URL only to your code.
Gordon
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

05-14-2019 04:07 - edited 05-14-2019 04:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-14-2019 04:07 - edited 05-14-2019 04:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hello @Gordon-C
if I HTTP GET https://api.fitbit.com/1/user/-/activities/list.json?afterDate=2019-05-13
I m getting back a HTTP 400 Error.
the same with :
https://api.fitbit.com/1/user/-/activities/list.json?afterData=2019-05-10&sort=desc&limit=10
same with :
always with that header
request.Method = "GET"; request.Headers["Authorization"] = "Bearer " + accesToken; request.Accept = "application/json";

05-14-2019 09:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



05-14-2019 09:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @DeniOcean
The 400 Error in your first API call is correct. The Get Activities List endpoint does have required query parameters that you need to add. Those are beforeDate or afterDate, sort, limit and offset. We have the information documented here: https://dev.fitbit.com/build/reference/web-api/activity/#get-activity-logs-list.
If you return the error message body, we should be providing you with a hint to the error.
I'm not sure if the other 2 examples contain a typo in your code or the forum post, but I see you misspelled "afterDate" as "afterData". Correcting that spelling error allows me to execute the last example successfully, https://api.fitbit.com/1/user/-/activities/list.json?afterData=2019-05-10&sort=desc&offset=3&limit=1...
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

05-14-2019 10:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

