Um, I am new to api… Wanting to show if streamers on a stream team are live on my site or even just a individual streamer. Clearly just testing my own account atm. Using a website I currently have to test on.
Thinking I need to get a OAuth token, below is as far as I got…
“object(stdClass)#4 (3) { [“error”]=> string(12) “Unauthorized” [“status”]=> int(401) [“message”]=> string(22) “OAuth token is missing” } lets see”
I mean I am game for really any kinda of PHP break down on how to get this done. Please be clear if I need to do something outside of PHP.
$ch = curl_init(‘https://api.twitch.tv/helix/streams?user_login=’);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Client-ID: ’
));
$data = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
if ($info[‘http_code’] != “”) {
$data = json_decode($data);
var_dump($data);
} else {
echo 'Failed with ’ . $info[‘http_code’];
}
die(“lets see”);