12-01-2020 21:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-01-2020 21:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi sorry if this has come up before but I couldn't find anything.
I am trying to work out how to setup the webhooks / subscriptions and the docs just aren't that clear around the flow and was hoping someone could assist.
I get that we have to create an endpoint and have that verified which I have done but what I don't get is how you add people to the hook / subscription.
The docs say to do a Post but it has little context into where in the user flow that post has to take place.
Once you have setup the webhook and had it verified, do you then have to do a Post to ( https://api.fitbit.com/1/user/-/activities/apiSubscriptions/320json) when someone first connects and authorizes their account? and for each user? or do you just run that once for no one in particular and then all new users automatically get added to the subscription?
cheers
Scott.

12-09-2020 17:50
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



12-09-2020 17:50
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @scottdogs,
Yes, you have to make a separate call for every user, using the token you get back from authorization. Keep in mind that you need to present the user with the scopes in your authorization URL to ensure that they consent to share that data with you when creating their subscription. The user must consent to the proper OAuth 2.0 scope before a subscription can be created for the collection. The list of requirements are:
activities
collection requiresactivity
body
collection requiresweight
foods
collection requiresnutrition
sleep
collection requiressleep
userRevokedAccess
collection has no scope requirements- If no collection specified,
activity
,nutrition
,profile
,settings
,sleep
,weight
scopes are required.
I hope this helps. Let me know if you have any additional questions.

