0

I'm trying to access the Nest API using REST from an embedded controller that doesn't have a Firebase library installed. There is NO way to install a Firebase library and the Nest docs seem to indicate that I should use REST API. I've gotten pretty far through the authorization process even though I receive a ton of HTTP page data and no json that I can discern. The docs talk about a wss: web socket but there's sparse information.

How can I use REST API to send https:// data (I'm using POST) and get the pertinent json data back rather than a huge web page?

I hope this question is clear. Basically, I don't have a web browser, I have to build everything myself in the embedded system.

TCoupe
  • 1
  • Are you telling it you want json data back? i.e.: setting the request header: `accept: application/json` – dc5 Jun 26 '14 at 21:28
  • The 'ton of HTTP' - is this one of the OAuth pages which the user should see? It might help if you describe how far you've actually got - do you have the pincode? If so, do you have the access token? – thesimm Jun 26 '14 at 23:30
  • If you are using embedded JS, you should be able to use the Firebase client, which would make things simpler and more efficient. Can you provide more information on your embedded platform? – David W. Keith Jun 27 '14 at 16:02

1 Answers1

0

Assuming you have exchanged a pincode for an authentication token, you can just call https://developer-api.nest.com?auth=AUTH_TOKEN using a GET.

thesimm
  • 774
  • 3
  • 12
  • Somewhere in the docs it says when I set up the client, it asked me if it would be web based or pin based authorization. I don't remember it asking me that... Is there a place in the client setup where I can set 'pin based authorization'? – TCoupe Jun 28 '14 at 23:11
  • 1
    If you don't enter an OAuth Redirect URI in the form, it will use PIN-based authorization. Otherwise, it will use web-based. You can switch to PIN-based by going back and deleting the Redirect URI in your Client Settings. – thesimm Jun 30 '14 at 08:03