How to make multistatement request with Alexa Skill - alexa

I am building an Alexa Skill and I need that when the user asks for information but it's missing the required fields for the back-end, Alexa asks the user back for this information. For example:
If the user asks What's the temperature? but does not give a location, Alexa asks back the location so it can be passed with the request to the back-end.
Another example is when you want to set a reminder and ask Alexa Set a reminder, she asks you for what and when is the reminder. I want to do the same with my skill.
Reading the documentation I noticed that there's a reprompt and a shouldEndSession entry in the response Object. Is this the right way to do what I want? Or is there any other way to achieve it?

I believe I found an answer. There is a directive for asking the user for missing values: the Dialog.ElicitSlot.
Similar question: Alexa input validation for type AMAZON.NUMBER using dialog model

Related

Creating a survey in amazon Alexa with open ended questions

I am trying to create a simple survey skill in Amazon Alexa where Alexa asks the user a question and they respond in any manner they feel like (open-ended). For example, if Alexa asks "Do you cook?", a user may respond in many ways such as "Yes I do cook", "My son does the cooking" etc.
The issue I am getting is that the questions can have similar responses so when I create an utterance in the Alexa dev console they overlap (utterance conflicts) and I am redirected to the error handler. (note each question has its own intent)
Is there any other way I can go about creating a survey without using intents?
Can I capture the full user response to a slot?
The reason being I want to store the user's response in a database.
Unfortunately, Alexa Skills aren't designed to do Speech To Text.
When a user talks to a device, the request goes through multiple steps:
Automated Speech Recognition > It does Speech To Text internally
Natural Language Understanding (NLU) > Using Machine Learning, it will understand what the user want to do (Stop a skill, play music, switch on the light, ...)
Depending of the context, if the NLU understand that the user is trying to respond to your skill (the interaction model match what the user is saying), it will send a POST request to your skill. But it will not send you the Speech To Text.
Documentation
Although, the intent AMAZON.SearchQuery will do the job but you will have to use a prefix: My answer is {query} and not directly {query} because all requests will be redirected to this intent otherwise. It will not look like a good & smooth user experience.

Alexa Out -of- session - Skill Messaging API

I’m trying to create an Alexa capability that creates reminders without user voice invocation. To achieve this Alexa suggested to use “Out of session” interaction event i.e Skill Messaging API (https://api.amazonalexa.com/v1/skillmessages/users/{userId}), as you can see in the API we need to pass the user Id, In order to get the user Id Alexa suggest to do first account-linking, once linking is done we’ll get the user profile access including userId. Now, after hitting the Skill Messaging API with received userId, it returns
{type:”not_found”, a message ”invalid user Id”}.
Not sure where am I going wrong. Has anyone phase the same problem.
In the request shown next, set HOST to one of the following, depending on the user's region: api.amazonalexa.com, api.eu.amazonalexa.com, or api.fe.amazonalexa.com

Alexa Skill - Retrieve User's mail within multi-turn dialog

I am developping an Alexa Skill within the one the user has to provide a serie of answers to my backend (node.js) in order to get the right result. I would like to send this result by email.
Is it possible to retrieve the user's email through the API put at disposal by AWS using the Dialog.delegate method?
Thanks !
There is no built in method can get you the current user email id or any personal info.
But with authentication you can. See this blog post. You'll need to create an Amazon App and link it to your amazon skill using Account Linking. For the first time when you ask for the email, user has to accept access with their Alexa app. You can then save this email in your DB for future purposes. This is a long but recommended method.
The simplest method: Whenever the game is finished you can manually ask the user for email address. But Alexa may not recognize email address spoken by users properly and might break your app. I don't know, but maybe Alexa will reject your app for asking personal info this way!

Alexa skill to change a variable on a website

I have an alexa skill and a website. I need to send requests from the alexa skill to change a certain variable on a website.
for examble, I have a name on the website lets say "michael", I want to be able to change that name to "zack" from alexa.
Alexa skill SDK allows you to perform remote calls to third-party APIs.
In your case, you can implement an API endpoint to change that field. Then you can call that endpoint with the data you need.
You can capture the name your user has been said.
By doing that, you would need to think how you will authenticate the user. Basically, you need to know how to match the user who is using Alexa with the user on your website. I don't think you want to change the name for the random user.

How to get the second utterance- Alexa

I am trying to build a conversational skill in Amazon Alexa. Once I start my skill, how can I know what the user said for the second time when I set should_end_session as false?
How do you mean what the user said for the second time? Any response a user provides in a live session should match one of the utterances for your skill and those utterances are linked to intents.
What response are you trying to get from the user? Please provide more information.

Resources