Hello,
for several months the display has no longer worked.
before, I use
‘https://api.twitch.tv/helix/users/follows?first=1&to_id=’.TWITCH_ID but now show error.
now I want test with
‘https://api.twitch.tv/helix/channels/followers?broadcaster_id=’.TWITCH_ID;
$ch = curl_init("https://id.twitch.tv/oauth2/token?client_id=".CLIENT_ID."&client_secret=".CLIENT_SECRET."&grant_type=client_credentials");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json'
));
$response = curl_exec($ch);
$data = json_decode($response, true);
$ch = curl_init('https://api.twitch.tv/helix/channels/followers?broadcaster_id='.TWITCH_ID);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Client-ID: ' . CLIENT_ID,
'Authorization: Bearer ' . $data['access_token']
));
$r = curl_exec($ch);
$i = curl_getinfo($ch);
The code return this, my array is empty
{“total”:494,“data”:,“pagination”:{}}
Thanks for your help