Missing required OAuth Scope after adding scope

Hey everyone

I was trying to use the API to create polls from my nodejs app, so I proceeded to create a new OAuth token with the “channel:manage:polls” scope. Since then, I can’t do anything with my new token : polls don’t work, “channel:manage:broadcast” scope don’t work anymore (I used it to change stream title / category).
All I get are “401 Unauthorized : missing required oauth scope” errors.

Create poll call :
request({
url: ‘https://api.twitch.tv/helix/polls’,
method: ‘POST’,
headers: {
Accept: ‘application/vnd.twitchtv.v5+json’,
Authorization: 'OAuth ’ + ,
‘Client-ID’:
},
json: true,
body: { }
}

Change title call :
request({
baseUrl: ‘https://api.twitch.tv/kraken/’,
url: ‘channels/’ + ,
method: ‘PUT’,
headers: {
Accept: ‘application/vnd.twitchtv.v5+json’,
Authorization: 'OAuth ’ + ,
‘Client-ID’:
},
json: true,
body: {
channel: { status: }
}
}

Is there something I’m missing?

Thanks for the help

You are trying to call the helix API with kraken headers. That won’t work.

For Helix:

  1. You don’t need the Accept header
  2. You need to use the keyword Bearer in front of the token instead of OAuth

Additionally, you need to add the required broadcaster_id query parameter for the polls endpoint to work.

For more info on kraken vs helix, see https://dev.twitch.tv/docs/api/migration

Also note: kraken will be shut down soon, so you’ll want to move away from it.

Thanks for all the useful info. I got it working with Helix. I also had to change the logic to set the channel category because it seems you can’t change it by name anymore, only by game_id.

Thanks a lot anyway!

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