I try to use API Nest for Nest Outdoor Cam, but I get a error.
I use this code PHP:
$url = "https://developer-api.nest.com/devices/cameras/".$deviceid."/is_online";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$data = curl_exec($curl);
if(curl_errno($curl)) {
echo "Erreur cURL : " . curl_error($curl);
}
curl_close($curl);
echo("Online : ".$data);
When I run the code :
Online : {"error":"unauthorized","type":"https://developer.nest.com/documentation/cloud/error-messages#auth-error","message":"unauthorized","instance":"92045a0b-1683-4d6f-bcd3-0c298916f40f"}
I need your help.
You can see the code and the result in top