2

I'm integrating with the Nest API and I'd like to know to whom an access_token belongs. I don't need an email or name or anything identifying the account holder, I just need a unique account identifier.

Is there something like https://developer-api.nest.com/account.json or user.json?

Documentation: API Reference

gsk
  • 1,233
  • 15
  • 32
Tiago Alves
  • 1,301
  • 2
  • 18
  • 30
  • Access tokens are normally short lived which means they normally change. In this instance I wonder if they do change or not. I would almost go with device_id but then the issue comes in what if they get a new device. – Linda Lawton - DaImTo Feb 17 '15 at 14:42
  • structure_id appears to be a unique id. Checking the documentation I wouldn't go with access_token it looks like I was right it could change. – Linda Lawton - DaImTo Feb 17 '15 at 14:46
  • 2
    Thanks for your comments. The problem with the structures is that users can simply create and remove structures and thus, their ids cannot be trusted to uniquely identify the account. The `access_token` is different for each new authentication so that can't be used either. Using the `device_id` is also an issue as you pointed out. A user might have a device and sell it to someone else so it would belong to another account. – Tiago Alves Feb 17 '15 at 14:59

1 Answers1

4

There isn't something account specific, but both structures and devices can only belong to one account, so you could use the structure_id as the unique identifier. It is unlikely that a user would delete their primary structure (kind of hard to to) and you can guarantee that any two users don't have the same structure.

You might notice this ID is different for each developer account, this is to protect the user's privacy. (e.g. developers can't serve ads based on unique identifiers)

David W. Keith
  • 2,246
  • 17
  • 20
  • Thanks for the reply and the insightful information. Using `structure_id` sounds good but we'd still prefer an ID that never changes. Can you tell me if this feature (providing an immutable `account_id`) is planned? – Tiago Alves Feb 18 '15 at 19:49
  • 1
    Honestly I have no idea, Nest accepts feature requests at community.nest.com – David W. Keith Feb 25 '15 at 00:21