<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How use API Nest Cam in Cameras and Doorbells</title>
    <link>https://www.googlenestcommunity.com/t5/Cameras-and-Doorbells/How-use-API-Nest-Cam/m-p/476184#M83916</link>
    <description>&lt;P&gt;This isn't a supported way of working with Nest products anymore, I'm afraid. See below:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://support.google.com/googlenest/answer/9293712?sjid=1932335619550637592-EU" target="_blank"&gt;Support for Works with Nest ending - Google Nest Help&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For advanced needs, Google launched the Google Home script editor which launched recently in preview:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://support.google.com/googlenest/answer/13323253?sjid=1932335619550637592-EU" target="_blank"&gt;Create advanced home automations with the script editor - Google Nest Help&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 02 Sep 2023 14:23:17 GMT</pubDate>
    <dc:creator>David_K</dc:creator>
    <dc:date>2023-09-02T14:23:17Z</dc:date>
    <item>
      <title>How use API Nest Cam</title>
      <link>https://www.googlenestcommunity.com/t5/Cameras-and-Doorbells/How-use-API-Nest-Cam/m-p/475346#M83789</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a Nest Cam Battery and I would use the API Nest for my site web. But I can't.&lt;/P&gt;&lt;P&gt;And also I learn that we will can't use Nest in a month. How I can do for use the API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this code PHP :&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;$url&lt;/SPAN&gt; = &lt;SPAN class=""&gt;"https://developer-api.nest.com/devices/cameras/"&lt;/SPAN&gt;.&lt;SPAN class=""&gt;$deviceid&lt;/SPAN&gt;.&lt;SPAN class=""&gt;"/is_online"&lt;/SPAN&gt;;
&lt;SPAN class=""&gt;$curl&lt;/SPAN&gt; = &lt;SPAN class=""&gt;curl_init&lt;/SPAN&gt;();
&lt;SPAN class=""&gt;curl_setopt&lt;/SPAN&gt;(&lt;SPAN class=""&gt;$curl&lt;/SPAN&gt;, CURLOPT_URL, &lt;SPAN class=""&gt;$url&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;curl_setopt&lt;/SPAN&gt;(&lt;SPAN class=""&gt;$curl&lt;/SPAN&gt;, CURLOPT_RETURNTRANSFER, &lt;SPAN class=""&gt;true&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;curl_setopt&lt;/SPAN&gt;(&lt;SPAN class=""&gt;$curl&lt;/SPAN&gt;, CURLOPT_FOLLOWLOCATION, &lt;SPAN class=""&gt;true&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;$data&lt;/SPAN&gt; = &lt;SPAN class=""&gt;curl_exec&lt;/SPAN&gt;(&lt;SPAN class=""&gt;$curl&lt;/SPAN&gt;);

&lt;SPAN class=""&gt;if&lt;/SPAN&gt;(&lt;SPAN class=""&gt;curl_errno&lt;/SPAN&gt;(&lt;SPAN class=""&gt;$curl&lt;/SPAN&gt;)) {
    &lt;SPAN class=""&gt;echo&lt;/SPAN&gt; &lt;SPAN class=""&gt;"Erreur cURL : "&lt;/SPAN&gt; . &lt;SPAN class=""&gt;curl_error&lt;/SPAN&gt;(&lt;SPAN class=""&gt;$curl&lt;/SPAN&gt;);
}

&lt;SPAN class=""&gt;curl_close&lt;/SPAN&gt;(&lt;SPAN class=""&gt;$curl&lt;/SPAN&gt;);
&lt;SPAN class=""&gt;echo&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"Online : "&lt;/SPAN&gt;.&lt;SPAN class=""&gt;$data&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;When I run the code :&lt;/P&gt;&lt;P&gt;Online : {"error":"unauthorized","type":"&lt;A href="https://developer.nest.com/documentation/cloud/error-messages#auth-error" target="_blank" rel="noopener"&gt;https://developer.nest.com/documentation/cloud/error-messages#auth-error&lt;/A&gt;","message":"unauthorized","instance":"92045a0b-1683-4d6f-bcd3-0c298916f40f"}&lt;/P&gt;&lt;P&gt;How I can solve this error and what i will do after a month?&lt;/P&gt;&lt;P&gt;Sorry for my bad English.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 08:25:48 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Cameras-and-Doorbells/How-use-API-Nest-Cam/m-p/475346#M83789</guid>
      <dc:creator>ErenTURKOGLU</dc:creator>
      <dc:date>2023-08-31T08:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: How use API Nest Cam</title>
      <link>https://www.googlenestcommunity.com/t5/Cameras-and-Doorbells/How-use-API-Nest-Cam/m-p/476184#M83916</link>
      <description>&lt;P&gt;This isn't a supported way of working with Nest products anymore, I'm afraid. See below:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://support.google.com/googlenest/answer/9293712?sjid=1932335619550637592-EU" target="_blank"&gt;Support for Works with Nest ending - Google Nest Help&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For advanced needs, Google launched the Google Home script editor which launched recently in preview:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://support.google.com/googlenest/answer/13323253?sjid=1932335619550637592-EU" target="_blank"&gt;Create advanced home automations with the script editor - Google Nest Help&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 14:23:17 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Cameras-and-Doorbells/How-use-API-Nest-Cam/m-p/476184#M83916</guid>
      <dc:creator>David_K</dc:creator>
      <dc:date>2023-09-02T14:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: How use API Nest Cam</title>
      <link>https://www.googlenestcommunity.com/t5/Cameras-and-Doorbells/How-use-API-Nest-Cam/m-p/476503#M83983</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Ok. Thanks. Now I try to use Device Access and API of SDM. But I get this error :&amp;nbsp;&lt;/P&gt;&lt;P&gt;Array ( [error] =&amp;gt; Array ( [code] =&amp;gt; 404 [message] =&amp;gt; Requested entity was not found. [status] =&amp;gt; NOT_FOUND ) )&lt;/P&gt;&lt;P&gt;I try to get RTSP Token and videourl.&lt;/P&gt;&lt;P&gt;Firstly I get the access token and after in try to get videourl and data rtsp.&lt;/P&gt;&lt;P&gt;I use this code PHP :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function getRTSPToken($client_id, $client_secret, $project_id, $device_id, $refresh_token) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; $auth_url = "&lt;A href="https://www.googleapis.com/oauth2/v4/token" target="_blank"&gt;https://www.googleapis.com/oauth2/v4/token&lt;/A&gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; $auth_data = array(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'client_id' =&amp;gt; $client_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'client_secret' =&amp;gt; $client_secret,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'refresh_token' =&amp;gt; $refresh_token,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'grant_type' =&amp;gt; 'refresh_token'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; // Effectuez une requête HTTP POST pour obtenir le nouveau jeton d'accès&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; $auth_curl = curl_init($auth_url);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; curl_setopt($auth_curl, CURLOPT_POST, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; curl_setopt($auth_curl, CURLOPT_POSTFIELDS, http_build_query($auth_data));&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; curl_setopt($auth_curl, CURLOPT_RETURNTRANSFER, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; $auth_response = curl_exec($auth_curl);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; curl_close($auth_curl);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; // Analysez la réponse JSON pour obtenir le nouveau jeton d'accès&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; $auth_data = json_decode($auth_response, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if (isset($auth_data['access_token'])) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $access_token = $auth_data['access_token'];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $api_url = "&lt;A href="https://smartdevicemanagement.googleapis.com/v1/enterprises/$project_id/devices/$device_id:executeCommand" target="_blank"&gt;https://smartdevicemanagement.googleapis.com/v1/enterprises/$project_id/devices/$device_id:executeCommand&lt;/A&gt;";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $api_headers = array(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Authorization: Bearer ' . $access_token,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Content-Type: application/json',&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $api_data = array(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'command' =&amp;gt; 'sdm.devices.commands.CameraLiveStream.GenerateRtspStream',&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'params' =&amp;gt; array(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'streamType' =&amp;gt; 'LIVE_STREAM' // Vous pouvez ajuster les paramètres ici si nécessaire&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Convertir les données en JSON&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $api_data_json = json_encode($api_data);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Effectuez une requête HTTP POST pour obtenir le token RTSP&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $api_curl = curl_init($api_url);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($api_curl, CURLOPT_POST, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($api_curl, CURLOPT_HTTPHEADER, $api_headers);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($api_curl, CURLOPT_POSTFIELDS, $api_data_json);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($api_curl, CURLOPT_RETURNTRANSFER, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Exécutez la requête HTTP&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $api_response = curl_exec($api_curl);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_close($api_curl);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Analysez la réponse JSON pour obtenir le token RTSP&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $api_data = json_decode($api_response, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print_r($api_data);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (isset($api_data['results']['rtspStream'])) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return $api_data['results']['rtspStream'];&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; } else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$rtsp_token = getRTSPToken($client_id, $client_secret, $project_id, $device_id, $refresh_token);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How I can revolve this.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2023 07:27:21 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Cameras-and-Doorbells/How-use-API-Nest-Cam/m-p/476503#M83983</guid>
      <dc:creator>ErenTURKOGLU</dc:creator>
      <dc:date>2023-09-03T07:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: How use API Nest Cam</title>
      <link>https://www.googlenestcommunity.com/t5/Cameras-and-Doorbells/How-use-API-Nest-Cam/m-p/476555#M83987</link>
      <description>&lt;P&gt;To get the best support with that, I'd recommend posting on &lt;A href="https://stackoverflow.com/questions/tagged/nest-device-access" target="_self"&gt;&lt;STRONG&gt;Stackoverflow using the&amp;nbsp;nest-device-access tag&lt;/STRONG&gt;&lt;/A&gt; as this is outside the scope of what we support in this community.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2023 11:11:35 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Cameras-and-Doorbells/How-use-API-Nest-Cam/m-p/476555#M83987</guid>
      <dc:creator>David_K</dc:creator>
      <dc:date>2023-09-03T11:11:35Z</dc:date>
    </item>
  </channel>
</rss>

