01-03-2021 20:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-03-2021 20:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
In the WebAPI documentation, the section about responding to a subscription notification to retriev data - https://dev.fitbit.com/build/reference/web-api/subscriptions/#example-notifications
An example is give of retrieving the data for an "activities" notification as follows:
https://api.fitbit.com/1/user/184X36/activities/date/2010-03-01.json
Which implies that you should be able to fill in the components from the notification message like such:
https://api.fitbit.com/1/{ownerType}/{ownerId}/{collectionType}/date/{date}.json
Or, assuming that you are dealing with a user, and the user is the user who's token was used for authentication header:
https://api.fitbit.com/1/user/-/{collectionType}/date/{date}.json
Which is close, but not quite. The difference is with "foods". Can you confirm that these are the correct endpoints to call to respond to the notifications?
- activities: /1/user/-/activities/date/{date}.json
- body: /1/user/-/body/date/{date}.json
- sleep: /1/user/-/sleep/date/{date}.json
- foods: /1/user/-/foods/log/date/{date}.json
Thanks,
Jeff
Answered! Go to the Best Answer.

- Labels:
-
Subscriptions API
Accepted Solutions
01-05-2021 16:32 - edited 01-07-2021 15:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-05-2021 16:32 - edited 01-07-2021 15:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Hi @Jeff_New_Ocean,
Thanks for reaching out to clarify if the endpoints your listed are the correct ones to use for the notifications you mentioned. For the most part, it is correct, except for the following:
- body: /1/user/-/body/date/{date}.json
- Correct endpoints are:
/1/user/-/body/log/weight/date/{date}.json /1/user/-/body/log/fat/date/{date}.json
- Correct endpoints are:
- sleep: /1/user/-/sleep/date/{date}.json
- Correct endpoint:
/1.2/user/-/sleep/date/{date}.json
- Correct endpoint:
There are plans to make the documentation clearer in regard to which endpoints should be called for each collection type, or simply make it easier to identify which scopes are needed for each collection type.
Thanks for continuing to shed light on what could be improved! Let me know if you have any other questions in the meantime.
01-05-2021 16:32 - edited 01-07-2021 15:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-05-2021 16:32 - edited 01-07-2021 15:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Hi @Jeff_New_Ocean,
Thanks for reaching out to clarify if the endpoints your listed are the correct ones to use for the notifications you mentioned. For the most part, it is correct, except for the following:
- body: /1/user/-/body/date/{date}.json
- Correct endpoints are:
/1/user/-/body/log/weight/date/{date}.json /1/user/-/body/log/fat/date/{date}.json
- Correct endpoints are:
- sleep: /1/user/-/sleep/date/{date}.json
- Correct endpoint:
/1.2/user/-/sleep/date/{date}.json
- Correct endpoint:
There are plans to make the documentation clearer in regard to which endpoints should be called for each collection type, or simply make it easier to identify which scopes are needed for each collection type.
Thanks for continuing to shed light on what could be improved! Let me know if you have any other questions in the meantime.
