I try to make an API call with Node Js. My Goal is to get the current state of my Phillips hue light.
But i always get an error message: SyntaxError: Unexpected token u in JSON at position 0 I searched the web but couldn't find a solution to solve the problem and i don't understand what this error message means.
here is the code i use to make the call( don't worry "username" is just a place holder).
const request = require('request');
request('https://192.168.1.10/api/<username>/lights/', function (error, response, body) {
var huelights = JSON.parse(body)
console.log(huelieghts);
});