Oauth2 client credentials keep failing

The Netatmo API is a set of webservices allowing developers and third parties to access Netatmo device's data.
Post Reply
LordTWO
Posts: 1
Joined: 19 Nov 2020, 21:25

Oauth2 client credentials keep failing

Post by LordTWO » 19 Nov 2020, 21:36

Hi all

I've set up an application on dev.netatmo.com and have retrieved the client_id and client_secret. However, when trying to get hold of the access_token using the client credentials option in Oauth2, I keep getting "400 Bad request" error. I have tried sending this through Postman, but no luck.

The following URL is posted from Postman:
https://api.netatmo.com/oauth2/token?gr ... &username=[email@email.no]&password=[MY_PASSWORD]&scope=read_station

I've doubled and triple checked that my CLIENT_ID, CLIENT_SECRET, username and password is correct. I have even tried resetting the CLIENT_SECRET, but without any luck.

The response is:
{
"error": "invalid_request",
"error_description": "Invalid grant_type parameter or parameter missing"
}

The app in dev.netatmo was created just yesterday, and is set up according to requirements. I have made sure that it is activated.

Any tips or hints on what could be wrong here?
Thanks.

Leslie
Posts: 25
Joined: 12 Feb 2020, 11:07

Re: Oauth2 client credentials keep failing

Post by Leslie » 20 Nov 2020, 07:43

Hello,

For your first /authorize request, you put infos as URL parameters
For your /token request, needed infos must be set in the Body

It should resolve your issue

Have a good day,
Leslie - Community Manager

Post Reply

Return to “Netatmo API”