我想獲得一定的抽搐片斷的數據,例如這一個https://clips.twitch.tv/MushyJollyWalrusUWot獲取抽搐剪輯數據
$videosApi = 'https://api.twitch.tv/kraken/clips/savjz/MushyJollyWalrusUWot';
$clientId = 'my client id';
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER => array(
'Client-ID: ' . $clientId
),
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $videosApi
));
$response = curl_exec($ch);
curl_close($ch);
$json = json_decode($response, TRUE);
print_r($json);
我正在與404錯誤的數組,但是這個代碼工作正常另一個抽搐API的東西,例如抽搐VOD:
$videosApi = 'https://api.twitch.tv/kraken/videos/125820676';
//the rest is same