question

Geoffrey B. Armstrong avatar image
Geoffrey B. Armstrong asked

How do I enumerate a user's endpoints? (smart home skill)

Greetings,

I'm working on a Smart Home skill, and I'd like to be able to proactively manage any changes in Alexa. I figure the best way to keep it in sync is to get a list of actual endpoints in my system (not Alexa) for the user in question, and then match that up with the endpoints that exist in the Amazon Alexa database (via the API), and then figure out what Add/Update and Delete calls need to be made to cause everything to be properly synchronized.

I see that Alexa Smart Properties skill allows for enumerating endpoints, but I don't see similar documentation elsewhere. I mean, this is basically an API for managing a collection, and I see the AddOrUpdateReport and DeleteReport calls, but I'm not seeing the List/Enumerate call.

I suppose I could maintain that list in my own database of what I believe the Amazon Alexa database *should* contain, however that could always get out of sync for one reason or another. So it would be best to get that state from the authoritative source (i.e. Amazon's Alexa API).

Am I missing something, or is their API missing something?

alexa smart home
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

KirkC@Amazon avatar image
KirkC@Amazon answered

Hello Geoffrey. Your observation that the Alexa Event Gateway only supports two kinds of reports AddOrUpdateReport or DeleteReport, is correct.

The Alexa Event Gateway does not currently have any functionality analogous to a "list" or "enumerate" call.

Although I'm not privy to the rationale behind specific design choices, my best guess would be that the lack of such a call is due to the fact that the purpose of the Alexa Event Gateway is to provide you, the third party Alexa smart home skill developer, a way to inform Alexa of changes to devices within your own device cloud, especially changes that take place outside of the user interacting with the Alexa app or their Echo device (for example, someone physically turning a switch on or off).

The assumption then is that you as the device manufacturer, will maintain your own "device cloud" which is the source of truth for all of the devices belonging to your users. This general architecture is outlined in the chart included in our "How the Smart Home API works" documentation here:
https://developer.amazon.com/en-US/docs/alexa/smarthome/understand-the-smart-home-skill-api.html#how-the-smart-home-api-works

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.