Search code examples
nest-api

Obtaining a Nest Access Token for sample


I'm just exploring the Nest Developers APIs, so thought I'd start with running the nestlabs/nest-twitter sample.

I've hit a couple of problems already! One is building the source, and the other is obtaining the Nest access token. I'll address the questions separately, so starting with the Auth problem...

I've created a developer account, and defined a new demo Product. From there I have used the Authorization URL https://home.nest.com/login/oauth2?client_id=[myClientId]&state=STATE, and from my regular Nest account successfully generated an eight character Pincode.

Back to the Product page, I plug the Pincode into the Authorization Token URL

https://api.home.nest.com/oauth2/access_token?client_id=[myid]&code=[myPincode]&client_secret=[mySecret]&grant_type=authorization_code

The response I get is "message":"404 Not Found".

What am I doing wrong?


Solution

  • You're most likely using an HTTP GET or PUT. Make sure you are using POST.