Broken mechanism,for pulling list of devices


#1

Hi,
I used the following to pull nest devices in my application, it works perfectly until now, what is wrong?, what been changed? :frowning:

POST : https://home.nest.com/user/login?username=“myemail”&password="mypass"
This return the following information:

  **AccessToken** = nestJson[OWM_ACCESSTOKEN];
  **UserId** = nestJson[OWM_USERID];
  var urlsObj = nestJson[OWM_URLS];
  APIUrl = urlsObj[OWM_APIURL];
  **TransportAPIUrl** = urlsObj[OWM_TRANSPORTAPIURL];

Then by using the TransportAPIUrl I pull the devices:

        $service_url = **TransportAPIUrl** . "/v2/mobile/user." . **UserId**;
        $curl = curl_init($service_url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        $arrHead = Array(
            "Host:" .**TransportAPIUrl**,
            "Content-Type:application/x-www-form-urlencoded",
            "http.agent:Nest/1.1.0.10 CFNetwork/548.0.4",
            "X-nl-client-timestamp:" . $milliseconds,
           "X-nl-protocol-version:1",
           "Accept-Language:en-us",
           "X-nl-user-id:" . **UserId**,
           "Authorization:Basic " . **AccessToken**
           );
        curl_setopt ($curl, CURLOPT_HTTPHEADER, $arrHead);
        $curl_response = curl_exec($curl);

#2

This is the unofficial API and shouldn’t be used. It can change at any time for any reason and we can’t support it. Head over to https://developer.nest.com to use the official API.