Hello,
It’s the first time that I work with an API like the Twitch one.
I try to retrieve informations about a specific streamer live statue.
All I want is to know if he is streaming, and if yes what is the title.
From what I found I am convinced that I should use this:
I created an application, so now I have a client ID, but now I need an OAuth token. How to get it ?
The only thing related to this on my application panel is “OAuth Redirect URLs”. What is it supposed to be ?
Here is how my php script looks like:
<?php
$ch = curl_init('https://api.twitch.tv/helix/streams?user_login=ponce');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Client-ID: bsqaagd3f2pgr0z7h3siw06l0j6bbk'
));
$r = curl_exec($ch);
curl_close($ch);
print_r($r);
?>
It returns ‘{“error”:“Unauthorized”,“status”:401,“message”:“OAuth token is missing”}’
How to make this works simply as it should be ?
I’m pretty sure that it is but i don’t get it
(It scares me to know that soon I’ll implement an authentification method using the same API)
Thank you