Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nest API how to get access_token

Tags:

nest-api

I got the authorization code from https://home.nest.com/login/oauth2?client_id=CLIENT_ID&state=FOO.

I want to get the access_token, but something wrong!

https://api.home.nest.com/oauth2/access_token?code=AUTHORIZATION_CODE&client_id=STRING&client_secret=STRING&grant_type=authorization_code

Result:

url: "/oauth2/access_token?code=xxx&client_id=xxx&client_secret=xxx&grant_type=authorization_code",
message: "404 Not Found"
like image 819
Sha-Pai Li Avatar asked Dec 03 '25 01:12

Sha-Pai Li


1 Answers

You need to POST your request. Also, the authorization code expires when used once, so you may need to get another.

like image 87
thesimm Avatar answered Dec 10 '25 01:12

thesimm