$(document).ready(function(){
//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=“https://api.twitch.tv/helix/streams?user_id=”+twitchers;
//declare get method
$.ajax({
//headers:"user-id:my-twitch-id ",
url:endPoint,
dataType: ‘json’,
async:false,
type:‘GET’,
username:“my-twitch-id”,
password:“my-twitch-secret”,
success: function(data){
console.log(data);
},
error:function(error){
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?
However FCC gives an alternative endpoint to the original twitch API so that you don’t have to register: https://wind-bow.glitch.me/
Refer to the challenge for further details.
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!