User should be subscribed to only 'activities' collection.
However tries to get list of his subscriptions fail:
1) call to GET /1/user/-/apiSubscriptions/xxxxxxx.json returns 403 'Forbidden. This application does not have permission to access nutrition data....'
2) call to GET /1/user/-/activities/apiSubscriptions/xxxxxx.json returns 405 'Method Not Allowed'
Is there any valid way to know if user is subscribed or not?
Thanks,
Maksym
Answered! Go to the Best Answer.
Best Answer
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
@MaksymSBW To get all subscriptions, a user has to have all scopes allowed, otherwise the call results in a 403. There isn't a way to call all subscriptions specific to your app unless you call them individually.
I'm not sure what you mean by "definitely allowed" because a user can select/deselect whatever scopes they want. If you're trying to look at a particular collection, then you use:
GET /1/user/-/{collection-path}/apiSubscriptions.json
Best Answer
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
@MaksymSBW Your GET request should look like this:
GET /1/user/-/{collection-path}/apiSubscriptions.json
If you're doing GET /1/user/-/apiSubscriptions.json --> that's for all of them at once. So if a user didn't grant access to a particular scope (nutrition in this case), then you'll get a 403.
https://dev.fitbit.com/docs/subscriptions/#getting-a-list-of-subscriptions
Best AnswerThanks for prompt response.
So if I understand correctly it is not possible to get all subscriptions that are allowed for our app for a user? As I don't know what scopes user allowed and what he opted out for my app, right?
And what about second part? Why can't I get a status of specific subscription that should be definitely allowed?
Best Answer
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
@MaksymSBW To get all subscriptions, a user has to have all scopes allowed, otherwise the call results in a 403. There isn't a way to call all subscriptions specific to your app unless you call them individually.
I'm not sure what you mean by "definitely allowed" because a user can select/deselect whatever scopes they want. If you're trying to look at a particular collection, then you use:
GET /1/user/-/{collection-path}/apiSubscriptions.json
Best Answer@AndrewFitbit, never mind, I found that we are calling subscriptions endpoint incorrectly, we were appending userID to the path.
Now everything works.
Thanks.