言語

Language not available Language not available Language not available

日本語での投稿は後日になります。大変申し訳ありません。

Client-ID required for Kraken API calls

May 5 2016 - By Dallas Tester

TL;DR: On Monday, August 8th, 2016, we’re going to really-for-real require the Client-ID header on all of your API requests to Kraken.

The longer version

Our Kraken API has always had a requirement of including the Client-ID header in order to not be rate limited. We’ve been lenient about this policy thus far and would allow requests without the header. On Monday, August 8th, 2016, we’re going to start requiring the Client-ID header. After the change, any request without the Client-ID header will be rejected.

How do I fix it?

If you’re already including the Client-ID header, no action is necessary. Otherwise, just use these simple steps to ensure you’re including the header on your request.

  1. Register your application on the Connections page in Twitch settings.

  2. Once registered, find your application under Other Connections on the Connections page. Click Edit.

  3. You will see your Client ID on the edit page.

  1. Add the Client-ID to the header of your request.

**jQuery**
$.ajax({
 type: 'GET',
 url: 'https://api.twitch.tv/kraken/channels/twitch',
 headers: {
   'Client-ID': 'axjhfp777tflhy0yjb5sftsil'
 },
 success: function(data) {
   console.log(data);
 }
});


**cURL**
curl -i -H 'Accept: application/vnd.twitchtv.v3+json'\ 
-H 'Client-ID: axjhfp777tflhy0yjb5sftsil'\ 
'[https://api.twitch.tv/kraken/channels/](https://api.twitch.tv/kraken/channels/hebo)twitch'


**PHP**
** array(
       'Client-ID: ' . $clientId
    ),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_URL => $channelsApi . $channelName
 ));
 
 $response = curl_exec($ch);
 curl_close($ch);
**?>**

That’s about it! I’ll keep reminding you to make the transition over the coming months.

As always, you can find us on the Twitch Developer Forums or on Twitter @TwitchDev.

その他のニュース