Thanks, i change code
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, “https://api.twitch.tv/kraken/channel”);
curl_setopt($ch,CURLOPT_CERTINFO, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: OAuth '.$code,
‘Accept: application/vnd.twitchtv.v5+json’,
‘Content-Type: application/json’,
'Client-ID: '.$clientid
));
$response = curl_exec($ch);
curl_close($ch);
Returns an error
{“error”:“Unauthorized”,“status”:401,“message”:“authentication failed”}
But if you go to the direct link I get the answer
“https://api.twitch.tv/kraken/channel?client_id=“.$clientid.”&oauth_token=”.$code
I get the code for php
OAuth Authorization Code Flow
‘https://api.twitch.tv/kraken/oauth2/authorize?client_id=“.$clientid.”&redirect_uri=http://mysite.ru/auth/&response_type=code&scope=user_read+channel_subscriptions&state=c3ab8aa609ea11e793ae92361f002671’;