I get a almost wrong access_token

The Netatmo API is a set of webservices allowing developers and third parties to access Netatmo device's data.
Post Reply
DarioPalmisano
Posts: 11
Joined: 02 Apr 2022, 16:50

I get a almost wrong access_token

Post by DarioPalmisano »

Hello,
I am using the API with grant_type=password, but I discovered that the access_token that I get it seems to be working with some commands (/homesdata and /homestatus), but if used with /getscenarios returns:
{
"status": "ok",
"time_server": 1653615693,
"body": {
"home": {
"id": "XXXXXXXXXX" (I modified tbe id for privacy)
},
"errors": [
{
"code": 1
}
]
}
}

If run the CLI command:
curl -X POST -d 'grant_type=password&client_id=XXXXPRIVACY&client_secret=XXXXPRIVACY&username=dario.palmisano@XXXXPRIVACY&password=XXXXPRIVACY&scope=read_smarther write_smarther' https://api.netatmo.com/oauth2/token

I get the same (flawed) access_token

while if I run the /getscenarios from https://dev.netatmo.com/apidocumentatio ... tscenarios (which works correctly) I discovered the access_token there specified is different!!!
Moreover the access_token produced by the web works perfectly also for the other /homesdata and /homestatus!!!
Is the procedure described to get the access_token really correct?
May anyone explain me the reason and how to correct?
Thanks in advance
Leslie
Posts: 112
Joined: 12 Feb 2020, 11:07

Re: I get a almost wrong access_token

Post by Leslie »

Hello Dario,

We apply "rights levels" to the tokens. For the Try-It function, the token retrieved have a higher access level allowing, for example, to automatically get all scopes without having to ask for it
The goal is to provide a fast and easy tool for testing purposes
The /getscenarios method works for Home + Control and Bubendorff shutters devices only. You retrieve an error because the request is correct (OK 200) but nothing can be shown in the array for a Smarther2

Have a good day,
Leslie - Community Manager
Post Reply

Return to “Netatmo API”