Auth2: access_token and refresh_token expiration time

The Netatmo API is a set of webservices allowing developers and third parties to access Netatmo device's data.
Post Reply
gulivert
Posts: 16
Joined: 20 Apr 2018, 09:39

Auth2: access_token and refresh_token expiration time

Post by gulivert » 20 Apr 2018, 10:10

Hi there,

It seems that the validation time of access_token return by API is not equal to expire_in.
Expire_in says 10800, means 3h, then if I understand correctly my access_token should work the next three hours and after should return an access denied, from there I should use refresh_token to get a new access_token.
The point is even after 24hours my access_token still work, I did not test until when I will get an access denied but I just want to know if I understand correctly.

By the way I programmed my application to request a new access_token from refresh_token when app boot up, take the current unix timestamp and add what api return in expire_in, on each get request I verifify if this time is still valid and if not refresh my access_token again, then the application works well like this.

Could you also tell us how many time the refresh_token remain valid ?

Thank you in advance for your answer.

Regards

Céline
Posts: 48
Joined: 20 Nov 2017, 18:17

Re: Auth2: access_token and refresh_token expiration time

Post by Céline » 20 Apr 2018, 15:07

Hi,

Access tokens expires in 3 hours but if you refresh a token before it gets expired, 3 hours more are added to the same access token validity. Refresh token never expire.
Céline - Netatmo Team :D

Post Reply

Return to “Netatmo API”