<?php
$ch = curl_init('https://api.twitch.tv/helix/clips?broadcaster_id=248145136');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Client-ID: yourclientID',
'Authorization: Bearer YourOauthToken'
));
$r = curl_exec($ch);
$i = curl_getinfo($ch);
curl_close($ch);
if ($i['http_code'] == 200) {
$data = json_decode($r);
if (json_last_error() == JSON_ERROR_NONE) {
// do stuff with $data
print_r($data);
} else {
echo 'Faiked with ' . $r;
}
} else {
echo 'Failed with ' . $r;
}
It is the same as the code I already posted just with my ClientID and Token instead of a placeholder