String Query Problem

Hey all,
Im pretty new to NODE JS and all that , but im trying to build somthing simple using the twitch API.

Im trying to use my client ID in the request that I do but I always get
{“error”:“Bad Request”,“status”:400,“message”:“No client id specified”}
even though my client ID is valid.
Im posting my code , because i suspect its not an error on my end (tried the same code for other APIs ).
Plase help me

If im breaking any rules forgive me for I am new here. :slight_smile:

var request=https.get("https://api.twitch.tv/kraken/streams/" + "sp4zie?client_id='myclientid' "+".json"
 ,function(response)
 {
	 
	console.log(response.statusCode);//the status of the api server //200 is good xD
	var body = ""; 
	response.on("data",function(chunk){ //gemizei the fckin body var with the fckin chunks from the fckin api
	
	
	body +=chunk;
	
	});
	 
	 response.on("end",function(){ //when data end
		 console.log(body); 
		 // var profile = JSON.parse(body);
		 // printMessage(id,profile.name);
	 });
 });

Try removing the + ".json". Also the client ID shouldn’t have single quotes around it.

var request=https.get("https://api.twitch.tv/kraken/streams/sp4zie?client_id=myclientid")
1 Like

Man thank you so much, it was the .json string.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.