Authentication failed trying to get channel subscribers

Headers: [Client-ID, Authorization (Bearer)]
Token scopes:[“channel:read:subscriptions”,“channel_subscriptions”]
token_type: bearer

When performing this request I get the response {"error":"Unauthorized","status":401,"message":"authentication failed"}

I feel like I am missing something obvious here but I can’t seem to find any info as to why this wouldn’t work?

Usually this sounds like you got an app access token instead of a user access token


  1. Send user to Twitch (using response_type=code)
  2. Authorise access to account
  3. Exchange code for token (and refresh token)
  4. ???
  5. Profit

Send user to twitch with url:<client-id>&amp;redirect_uri=http%3A%2F%2Flocalhost&amp;response_type=code&amp;scope=channel%3Aread%3Asubscriptions+channel_subscriptions

Then taking the code from the redirect perform a post to:<client-id>&client_secret=<secret>&code=<the-code>&grant_type=authorization_code&redirect_uri=http%3A%2F%2Flocalhost

Then perform the request to the channel using the returned “access_token”. Is that not the correct flow?

That is correct yes!

For kraken, it’s oAuth not Bearer. I missed you were calling kraken and tying to use “bearer”

headers: Authorization: oAuth <TOKEN>

So using 'Authorization': 'OAuth <token>'
{“error”:“Unauthorized”,“status”:401,“message”:“missing required oauth scope”}

I can’t seem to find any scope “oauth”, (getting scope list from

This was my mess up, I was using the wrong token here. It works now, thanks for your help :slight_smile:

Requires channel_subscriptions scope

kraken/v5 doesn’t return a useful error.

You can check the scopes a token has by calling

With the token

And additionally you need to be using the channel_id not the channel name

As v3 is “dead”

Problem solved, thank you for the assistance :slight_smile: Can close the thread

1 Like

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