Hi, I’m creating a bot which I want to change the status of the stream. However, i cannot seem to see where I’m going wrong with the code below. I get the Oauth token here http://twitchapps.com/tokengen/ with the scopes channel_editor and channel_read however, i still get a ‘400 error bad request’
var title = ’ this is a title’;
$.ajax({
url: ‘https://api.twitch.tv/kraken/channel/lovenpk?channel[status]=’+ title+’&_method=put’,
type: ‘GET’,
contentType: ‘application/json’,
dataType: ‘jsonp’,
headers: {
‘Accept’ : ‘application/vnd.twitchtv.v5+json’,
‘client-ID’ :‘CLIENT_ID’,
‘Authorization’: ‘OAuth Oath-TOKEN’
},
success: function(data) {
console.log(data.status);
console.log(data)
}
});
});