Error accesing homesata

The Netatmo API is a set of webservices allowing developers and third parties to access Netatmo device's data.
Post Reply
mromani
Posts: 2
Joined: 17 Jul 2018, 17:01

Error accesing homesata

Post by mromani » 17 Jul 2018, 17:29

Hi,

I developing a python-netatmo interface and can't access home data,

Code: Select all

 headers = {'Authorization': 'Bearer ' + self.config["access_token"]}        
        response = requests.post("https://api.netatmo.com/api/homesdata",  headers=headers)       
        response.raise_for_status()
        print (response.json())
I always get the following response:

Code: Select all

raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.netatmo.com/api/homesdata
if I try to send the request from a webservices test tool with the following data and the response is always the same

Code: Select all

POST https://api.netatmo.com/api/homestatus
Accept: application/json
Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json
Response:

Code: Select all

{
   "error": {
      "code": 13,
      "message": "Application does not have the good scope rights"
   }
}

mromani
Posts: 2
Joined: 17 Jul 2018, 17:01

Re: Error accesing homesata

Post by mromani » 18 Jul 2018, 17:26

Solved, there was an error in the scopes string passed to auth and I was always getting scope read_station instead of read_thermostat

Post Reply

Return to “Netatmo API”