I have a webpage that returned the most recent 3 subscribers, howevr ever since API V5 was depreciated it no longer works. And i cannot for the life of me figure out how to switch to the Helix API.
My old code was like this,
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, “https://api.twitch.tv/kraken/channels/champdrivescars/subscriptions?limit=3&direction=desc”);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “GET”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Client-ID: ####’,
‘Authorization: OAuth ####’
));
Client ID came from my developer app although I do remember where the OAuth key came from.
But I tried to switch it to this…
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, “https://api.twitch.tv/helix/subscriptions?broadcaster=424051192”);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “GET”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Client-ID: ####’,
‘Authorization: Bearer ####’
));
First off, I have no idea if that is my broadcaster id or not, cant seem to find any info on where you get that, also I am using the same client id from my app, and I see that oauth should be switched to Bearer, but again no idea where that key comes from, and i get the error Missing channel:read:subscriptions scope
Any help is appreciated, not super familiar with this but I am using PHP to try and get the data.