0

I have a Google Nest Cam (Battery). I would get the stream live of the cam. I use SDM API and Device Access, but I get this error

Array ( [error] => Array ( [code] => 404 [message] => Requested entity was not found. [status] => NOT_FOUND ) )

I use this code PHP :

$client_id = 'CLIENTID';
$client_secret = 'CLIENTSECRET';
$device_id = 'DEVICEID';
$redirect_uri = 'http://localhost'; // L'URL de redirection que vous avez configurée dans la Console Google Cloud

    $access_token = "ACCESSTOKEN";
    $refresh_token = "REFRESHTOKEN";

    $camera_url = "https://smartdevicemanagement.googleapis.com/v1/enterprises/PROJECT-ID/devices/{$device_id}";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $camera_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer {$access_token}"
]);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Erreur cURL : ' . curl_error($ch);
} else {
    $camera_response = json_decode($response, true);
}
curl_close($ch);

print_r($camera_response);

How I can resolve this? I need your help.

I do research in Net., but I doesn't found the source of the problem. All Id-Key is correct.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

0 Answers0