11-06-2015 15:17
11-06-2015 15:17
Where is the subscription ID associated with a fitbit user? I see in the docs that we provide a subscription ID when subscribing, but there is no association with a particular user account.
Answered! Go to the Best Answer.
11-10-2015 08:25
11-10-2015 08:25
To answer my own question, the association between the user and subscription is made because the subscription is called with the user's Bearer token. The API doc is not very clear about that, and we were making the mistake of not seeing where to provide the user ID in a server (ours) to server (fitbit) call.
11-06-2015 15:56
11-06-2015 15:56
If you want to see the subscriptions your application has created for a user, use the endpoint documented here.
11-06-2015 18:12
11-06-2015 18:12
We don't have existing subscriptions, we are trying to setup subscriptions. There doesn't seem to be an association between a user and a subscription ID in the API calls, that's what I'm looking for. So in the API example 320 is used for the subscription ID. How is that related to a user? We can certainly relate that to a user ID on our side if needed, but it wouldn't mean anything to fitbit.
11-09-2015 10:36
11-09-2015 10:36
Your app defines the id for the subscription. We recommend a pattern that is useful to your application. The Fitbit user id is included in the notification, but you might use a different id for the user. Some app use a pattern of "myAppsUserId-fitbitUserId-resourceCollection". The subscription id is also returned in the notification.
11-09-2015 12:32
11-09-2015 12:32
I must be misunderstaning the API doc. The graphic at the top says "Add a subscription for the user to get notifications and return a response in the format requested.". Are you saying we don't add a subscription per user? So we automatically get notifications for all our users?
11-10-2015 08:25
11-10-2015 08:25
To answer my own question, the association between the user and subscription is made because the subscription is called with the user's Bearer token. The API doc is not very clear about that, and we were making the mistake of not seeing where to provide the user ID in a server (ours) to server (fitbit) call.
11-10-2015 10:53
11-10-2015 10:53
@DavidHolmes wrote:
To answer my own question, the association between the user and subscription is made because the subscription is called with the user's Bearer token. The API doc is not very clear about that
Correct—all* API requests are made on behalf of the person who authorized your app.
* The only exceptions are a few endpoints for general resource (loggable food and activity types) listings and search.
11-10-2015 12:07
11-10-2015 12:07
Thanks Jeremiah. It seems extremely obvious in hindsight, and would have never come up for any other calls for user data. But working on the subscription in isolation it's not so obvious.
11-22-2016 19:32 - edited 11-22-2016 19:37
11-22-2016 19:32 - edited 11-22-2016 19:37
Sp does that mean that when the user authentication is complete, we should send another POST request for the subscription with the user token as the subscriber-id. Also what happens when the access token is refreshed.
10-13-2019 23:44
10-13-2019 23:44
Yes I am wondering the same question as GlobeTrekkerDev