I have a problem.
I try to set “status”, “game” and “lang” using JavaScript API and the callback returns the same (not changed at all) configuration. I just don’t understand, what did I do wrong???
Here is my code: Twitch.api({method: '/channels/' + login, verb: 'PUT', params: { channel: { status: document.getElementById("title").value, game: document.getElementById("activity").value, language: document.getElementById("language").value } }}, function(error, channel) { if (error) { console.log(error); } }); if ($('language-mode').prop("checked")) { Twitch.api({method: '/channels/' + login, verb: 'PUT', params: { channel: { broadcaster_language: document.getElementById("language").value } }}, function(error, channel) { if (error) { console.log(error); } }); }
And the response returns just the same information. Not changed data.
What is wrong with my code???
No, I get status. And it is… empty. Like empty. Nothing is in output. M.b. I get it somehow wrong… I just don’t know how to get status in a right way… I tryed to do it like “console.log(status)”, but not shure if it is correct…
If you’re using the CDN URL for the Twitch SDK (https://ttv-api.s3.amazonaws.com/twitch.min.js), it’s outdated and doesn’t support the verb option, so your request is being sent as a GET. Download the one on github.