So I’ve got my auth token back successfully but when I try run the /user part it just says invalid auth code or scope.
The scope on my auth code that comes back is user_read and on the twitch api page it says this is all it needs to use /user.
The code:
$token = $jresult[‘access_token’];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘https://api.twitch.tv/kraken/user’);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, 'Authorization: OAuth '.$token );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$retval = curl_exec($ch);
curl_close ($ch);
$result = json_decode($retval, true);
What am I doing wrong to cause this? Been trying to figure it out for 3hours now.