0
votes

The Alexa List API FAQ says as follows:

How can a developer determine that an event has been triggered due to their skill?

Consider this scenario:

  • The customer creates a to-do in the app.
  • The skill service uses the Skill Messaging API to send a message to the skill to create a list item in Alexa.
  • The skill receives the Skill Messaging API message and POSTs to householdlist and list items.

In response to the POST, the skill service records the alexa_item_id locally. An ItemsCreate event also occurs as a list item was just created. Alexa triggers an event even if a list item is created by calling List API. Skill developers can use the item_id value returned by CreateListItem to uniquely identify an item.


Now my question:

Is there any more precise information / sample on that? (I am still new to node.js and alexa development)

In my current skill implementation (AWS Lambda endpoint) list elements are added via ask list API which results in return in receiving the ItemsCreated event a few seconds later in the same lambda.

Currently I cannot filter out events like that which results in en endless circular update loop. The same is true for delete events while it stops after the first try here.

  • How can I determine that I can skip this event?
  • Where/how shall I store/cache this (e.g. the item_id mentioned above) information?
  • How do I get to this information seconds later (while other users may have called into the lambda meanwhile)?

Note:

Both happens out of session.

2
Illustration where Service A is Microsoft Graph API: Service A >> add ele in Service list >> notify Skill Lambda >> add ele in Alexa list >> notify Skill Lambda >> add ele in Service List >> ... breakout needed here.Jens

2 Answers

0
votes

Seems there is no built-in way to achieve that.

From the FAQ I conclude that I need my own persistency (e.g. dynamoDB) and store item_id / user_id there in order to check the events.

https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs#persisting-skill-attributes-through-dynamodb

If any concerns or any easier way applicable - please let me know.

0
votes

Ok You must use the Api with webhook so, for any webhook event comes from system A , you must do a request api to the system B to get the data about this Item e.g

then you must compare the data which come by webhook and the data that return from api , if no difference then stop
else continue in effecting in the System B