Scope permisison to /subscritions api

My token have the scopes:

content: b’{“client_id”:“…”,“scopes”: “channel:read:subscriptions”,“channel_subscriptions”],“expires_in”:4916437}\n’

When y call endpoint ‘https://api.twitch.tv/helix/subscriptions

mycode.py

header = {‘Authorization’: ‘Bearer r2nsg1pcge49x…qqwatz7yu5’}
params = {‘broadcaster_id’: 149278888}
requests.get(_url, headers=header, params=params)

I have the return:
_content: b’{“error”:“Unauthorized”,“status”:401,“message”:“Missing scope: channel:read:subscriptions or channel_subscriptions”}’

The same token is used in oauth2/validate, /user and /videos with success.

Can anyone help me with this?

Which OAuth flow did you use? The Client Credentials flow will generate an App access token, where as for any endpoint requiring scopes you need a User Token from going through either the Implicit or Auth Code flows, as only then will there be user interaction to grant those permissions.

/user and /videos doesn’t require user permissions, which would explain why an App token works for those endpoints, but any endpoint requiring a scope would fail.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.