04-01-2017 09:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-01-2017 09:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi,
I'm trying to access data with this call:
https://api.fitbit.com/1/user/-/activities/list.json?afterDate=2017-03-28&limit=10&offset=0
But I keep getting this response:
{"errors":[{"errorType":"validation","fieldName":"offset","message":"Offset is required"}]}
Am I missing something?
Thanks!
Answered! Go to the Best Answer.

Accepted Solutions
04-01-2017 12:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



04-01-2017 12:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@jbarranis Ah I see. Add quotes around the endpoint like this:
curl -i -H "Authorization: Bearer <access_token>" "https://api.fitbit.com/1/user/-/activities/list.json?limit=10&sort=desc&beforeDate=2016-03-30&offset=0"

04-01-2017 10:00
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



04-01-2017 10:00
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@jbarranis That's strange because you're missing "sort", not "offset".
here's an example:
https://api.fitbit.com/1/user/-/activities/list.json?limit=10&sort=desc&beforeDate=2017-03-28&offset=0

04-01-2017 10:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-01-2017 10:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I wonder if it's related to how it's getting interpreted. I'm using curl to test it out and now I'm getting a different error:
curl -i -H "Authorization: Bearer <access_token>" https://api.fitbit.com/1/user/-/activities/list.json?limit=10&sort=desc&beforeDate=2017-03-28&offset=0
Now the error is:
{"errors":[{"errorType":"validation","fieldName":"date","message":"beforeDate or afterDate is required"}]}

04-01-2017 12:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



04-01-2017 12:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@jbarranis Ah I see. Add quotes around the endpoint like this:
curl -i -H "Authorization: Bearer <access_token>" "https://api.fitbit.com/1/user/-/activities/list.json?limit=10&sort=desc&beforeDate=2016-03-30&offset=0"

04-01-2017 13:07
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-01-2017 13:07
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Yep, that was it! Thanks @AndrewFitbit!
