So I’m trying to collect the total amount of subs the logged ind user have.
But I’m getting these error’s and I’m not sure why.
[Twitch] Response Data: {error: "Unprocessable Entity", status: 422, message: "undefined does not have a subscription program"}
[Twitch] API Error: Unprocessable Entity; undefined does not have a subscription program
Here’s what I’m doing:
Javascript
var streamerName;
...
var subCountURL;
$(document).ready(function() {
Twitch.init({
clientId: Client_ID
}, function(error, status) {
// the sdk is now loaded
Twitch.api({
method: 'channel'
}, function(error, channel) {
streamerName = channel.name;
...
subCountURL = "channels/" + streamerName + "/subscriptions";
updateUI();
});
Twitch.api({
method: "channels/" + streamerName + "/subscriptions" // CALLING THE SUBS HERE - THIS DOESNT WORK
}, function(error, channels) {
totalSubs = channels._total;
updateUI();
});