Reputation: 317
My interaction has to be executed in two steps. in first step. Alexa will get some information to the user. On the basis of published information, Alexa will ask to take another action from the user's answer (Which is yes/no).
So is it possible to invoke one intent and on the basis of previous intent's reply through reprompt, i would be able to call another intent of alexa app.
if so, then how can i do that through akexa node js SDK v2.
Use Case:
My app is connecting with third party API which needs alexa to use Account Linking. Scenario is, when my account is linked and i have valid access token. Here's how conversation will go:
User: Alexa, ask "a" to get me overdue invoices.
Alexa: You have "x" number of invoices. Do you want to send payment reminders?
User: Yes.
Alexa: Your request to send reminders has been registered. Anything else I can help?
User: No Thanks.
So for this, I have to communicate with an external API two times. One, while getting overdue invoices, and two, while sending reminders.
Upvotes: 1
Views: 1082
Reputation: 3287
From your example, I'm guessing you have invoices
as one intent, then reminders
as another intent. If reminders
is only ever used immediately after invoices
, then I'd make them a single intent. But if you want users to create reminders at any point, or if you have multiple intents that could flow into the reminders
intent, then separate intents can work.
Check out: How to Pass a new Intent
Each of the Dialog directives includes an
updatedIntent
property that can take an Intent object. Use this to:
- Trigger a dialog on a completely different intent. For example, after completing the dialog for a BookFlight intent, you could return
Dialog.Delegate
withupdatedIntent
set toBookRentalCar
to start new dialog....
When you useupdatedIntent
to change to a different intent, the directive acts against the new intent instead of the original:...
When you useupdatedIntent
to set or change data on the original intent, make sure that the intent name and full set of slots matches the intent sent to your skill.
So to use your example, this is what you would do:
User: Alexa, ask SkillName to get me overdue invoices.
invoices
intent. Dialog.Delegate
or Dialog.ElicitSlot
or Dialog.ConfirmIntent
with updatedIntent
set to reminders
intent. (include any and all slots, must be a full intent object)Alexa: You have X number of invoices. Do you want to send payment reminders?
User: Yes.
confirmationStatus
, or AMAZON.YesIntent
.Alexa: Your request to send reminders has been registered. Anything else I can help?
Upvotes: 1