Lacking in essential ajax knowledge

Lacking in essential ajax knowledge
0.0 0

//make sure jquery library is working
$(“p”).append(“hello world”);
//declare stream array
var twitchers=[“dmbrandon”,“MedryBW”,“ESL_SC2”, “OgamingSC2”, “cretetion”, “freecodecamp”, “storbeck”, “habathcx”, “RobotCaleb”, “noobs2ninjas”];
//declare endpoint
var endPoint=“”+twitchers;
//declare get method

//headers:"user-id:my-twitch-id ",
dataType: ‘json’,
success: function(data){
console.log("Your ERROR is: "+ error);


i have been trying to figure this out and i feel that I’m messing up in the header method i believe that it is asking me to give a header with my id and secret but i really don’t get how to do that and haven’t seen how to online yet any advice on where to look, should i read up on curl?


according to Twitch documentation you need to authorise your request with a given token.
(tbh it’s a very common practice)

Pretty much you have to get the token, then add it in the header request:

 type: 'GET',
 url: '',
 headers: {
   'Client-ID': YOUR_TOKEN

More on an official twitch blog post

However FCC gives an alternative endpoint to the original twitch API so that you don’t have to register:
Refer to the challenge for further details.

Hope it helps :slight_smile:


I’ve sort of pieced together how to do it using api v5/kraken but i wanted to do it in the new api/helix since the old one will be removed at the end of the year, and it is a little different so i havent seen a lot of documentation on this api

thank you so much for the extra information though!


According to the documentation you still need to obtain a token from Twitch, and the add it as a Bearer token in the header:

headers {
      authorization: 'Bearer YOUR_TOKEN',