Tutorial by Examples

PHP

The following will retrieve a channel object for the twitch channel and echo the response. $channelsApi = 'https://api.twitch.tv/kraken/channels/'; $channelName = 'twitch'; $clientId = '...'; $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_HTTPHEADER=> array(...
The following will log the JSON response from the API to the console if the request was successful, otherwise it will log the error. var xhr = new XMLHttpRequest(); xhr.open('GET', 'https://api.twitch.tv/kraken', true); xhr.setRequestHeader('Client-ID', '...'); xhr.onload = function(...
The following will retrieve a channel object for the twitch channel. If the request was successful the channel object will be logged to the console. $.ajax({ type: 'GET', url: 'https://api.twitch.tv/kraken/channels/twitch', headers: { 'Client-ID': '...' }, success: function(data...

Page 1 of 1