I met message "Missing channel:read:subscriptions scope"

Hello Experts,

I tried to get broadcaster’s subscription information.
But, I met message “Missing channel:read:subscriptions scope”.
My work was below.
What is reason that get result below?

1.get token
https://id.twitch.tv/oauth2/token?client_id=eeeeeeeeeeeeeeeeeeeeeeeee&client_secret=REMOVED&grant_type=client_credentials&scope=channel:read:subscriptions
{“access_token”:“xxxxxxxxxxxxxxxxxxxxxxxxxxx”,“expires_in”:4719182,“scope”:[“channel:read:subscriptions”],“token_type”:“bearer”}

2.token validation
curl -H "Authorization: OAuth xxxxxxxxxxxxxxxxxxxxxxxxxxx " -X GET https://id.twitch.tv/oauth2/validate
{“client_id”:“aaaaaaaaaaaaaaaaaaaaaaaaa”,“scopes”:[“channel:read:subscriptions”]}

3.get broadcaster information
curl -H ‘Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxx’ \ -X GET ‘https://api.twitch.tv/helix/subscriptions?broadcaster_id=123
{“error”:“Unauthorized”,“status”:401,“message”:“Missing channel:read:subscriptions scope”}

You’re requesting an App Access token, not a User Access token. You need the user you want to see data for go through the Authorization Code Flow https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#oauth-authorization-code-flow

Also, you just exposed your client secret which is a violation of the dev agreement. Please revoke that immediately, and don’t expose secrets/tokens again.

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