1

Good day. Im trying to change stream title via this code:

titleStr = "Playing cool new game!";

$.ajax({
            url: 'https://api.twitch.tv/kraken/channels/my_channel?channel[status]='+titleStr+'&oauth_token=' +token,
            type: 'PUT',
            dataType : 'jsonp',
            contentType: 'application/json',
            success: function(data) {
              console.log(data.status);
            }
});

It returns succsess (current title), but nothing changes. However i tested url with Chrome App named Postman and its perfectly works.

UPD: Twitch API

1 Answer 1

1

Finally solved. Twitch api have an undoc feature '&_method=put' thru 'GET' =\

$.ajax({
            url: 'https://api.twitch.tv/kraken/channels/mychannel?channel[status]='+titleStr+'&oauth_token=' +token+'&_method=put',
            type: 'GET',
            contentType: 'application/json',
            dataType: 'jsonp',
            success: function(data) {
              console.log(data.status);
            }
}); 

This code works well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.