Now that there is a helix endpoint for modifying channel information, I wanted to upgrade my chat bot a bit. But I’ve ran into a bit of a problem here. My api call looks like this
request({
url: 'https://api.twitch.tv/helix/channels',
qs:{
broadcaster_id: broadcasterID,
game_id: gameID,
},
method: 'PATCH',
headers: {
Authorization: 'Bearer ' + accesstoken,
'Client-ID': clientID
},
json: true
}, (err, response, body) => {
/* handling response */
});
Using this with an app accesstoken returns a 401 - unauthorized. I made sure that the token was generated with the correct scopes. So i thought, I might need to use the token I’ve generated for the bot in order to connect to Twitch IRC.
So it has the form ‘oauth:<token>’ I’ve tried putting the token into the Authorization header. I also tried to replace Bearer with OAuth like the old Authorization did. It didn’t work. So I then thought, my broadcaster_id might be wrong.
When i request my channel information, i get this:
{
data: [
{
id: '<id>',
user_id: '<user_id>',
user_name: '<name>',
game_id: '<game_id>',
/* */
I’ve tried using both id and user_id but nothing worked. I’m definitely missing something here, but I can’t figure out, what exactly. Any ideas?