I forgot one thing!
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Client-ID: ' . CLIENT_ID,
'Authorization: Bearer ' . $keys->access_token
));
should be
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Client-ID: ' . CLIENT_ID,
'Authorization: Bearer ' . $keys->access_token,
'Content-Type: application/json'
));
Hinting the “type” of the content being passed helps the reciever understand what kind of data is being passed and how to interpret it, in this case Twitch Defaults to one of the form types and we are not sending a form.
You mean like the one I have that is linked on my github? ![]()