-1

I am having some problems with my Alexa skill. I would like the dialogue to go like this:

User: 'Alexa, open party'

Alexa: 'Hello, what is your four digit secret pin?'

User: '1234'

Alexa: 'Confirmed, what can I help you with?'

But I am confused on how to structure this. I need to take the user's pin and verify it in my codebase. I know you cant get dialogue delegation to work inside of the LaunchRequest. The LaunchRequest can not be customized, so I cannot add slots to it. I can't find any other suggestions/examples on the internet. Has anyone done this before or are there any suggestions?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Dane Lowrey
  • 170
  • 1
  • 10
  • Your example dialogue contradicts the help you are looking for. In the example a launchRequest would trigger your skill asking for the pin. After that you ask if the user can specify their pin in a launch request. – aberger Jun 22 '17 at 17:51
  • I have figured some other stuff out which makes this question irrelevant now so I apologize if there is any confusion. I am about to close it. – Dane Lowrey Jun 22 '17 at 19:37

2 Answers2

0

Amazon supports account linking as the method to connect users with their other accounts. This allows users to log into their other account using OAuth at the time the skill is installed. While it may be possible to determine a user based on the session object userid, it may be difficult to get such a skill published.

Ron Lisle
  • 1,164
  • 6
  • 11
  • Right but after the user links an account I would still like to have them state their four digit pin before they can actually use anything in my skill, kind of like the four digit pin on a phone. – Dane Lowrey Jun 21 '17 at 13:25
  • Ok. Have you tried receiving the number input as an intent with a slot for the number? For example, "my pin is {PinSlot}", "it is {PinSlot}", "{PinSlot}", "{PinSlot} is my pin" – Ron Lisle Jun 21 '17 at 20:04
  • I am doing that now, and its working, but only if you do not use the Skill Builder Beta. The Skill Builder Beta will not allow utterances of just slots (i.e. an utterance "{PinSlot}"). Now I am running into another problem, because apparently you can not build a dialog model without the beta. – Dane Lowrey Jun 22 '17 at 16:47
0

It turns out that you can not delegate slot collection to Alexa within the LaunchRequest, because it is not part of a valid response type for LaunchRequest.

My Initial logic was:

  1. User says 'Alexa, open party'
  2. Alexa Skill calls LaunchRequest. (At this point I need to ask the user for their pin by delegating Alexa to do slot colleciton)
  3. In the LaunchRequest, immidiately respond with this.emit(':getPinIntent'); where getPinIntent is another intent existing in my Alexa Skill. The above code is what I saw on the internet for how to call another intent without the user having to provoke using voice.
  4. getPinIntent gets called and immediately it checks to see if all the required slots are filled (i.e. if the slot PIN has a value). If they are not and dialogState !== 'COMPLETED' then I delegate the slot collection to Alexa.
  5. The above step (#4) is where things go wrong. Because delegation is not a valid response type for LaunchRequest's, there is no field dialogueState which is required for delegation to Alexa. The Alexa Request is still a LaunchRequest instead of an Intent request because the user did not invoke the intent by saying something to Alexa.
  6. In conclusion this is not a valid way of completing a dialogue where upon launch the user is asked for a pin and then can reply by only saying that pin, visualized below:

User: "Alexa, open party"

Alexa: "What is your pin" (alexa never gets here, because of #4 and #5 above)

User: "one two three four"

Alexa: "Confirmed, what can I help you with?"

If I have made any mistakes or wrong assumptions please let me know.

My current logic has now changed. If you do not use the Skill Builder Beta you can have a slot exist as an utterance for one of your intents. So I now have getPinIntent with a slot called {PIN} and an utterance in the form of {PIN}. This lets the above type of conversation happen because when the user says his or her pin back ("one two three four") it starts the getPinIntent where I can then continue OR delegate the dialogue to Alexa because for IntentRequest dialog is a valid response type.

The only problem I have now is that because I am not using the Skill Builder Beta I can not (or have not found a way) to add Dialogue Models to/inside of my Intent Schema. I have tried copying the JSON text from the Skill Builder Beta into my Intent Schema after adding the correct Dialogue Model, but this always results in build errors.

So now I can complete the user's pin authentication and respond with a "How can I help", but the IntentRequest that comes after that may require delegation to Alexa for slots, and this would cause a crash because without the Skill Builder Beta I am unable to add the appropriate dialogue models for Alexa to use during delegated slot collection.

Community
  • 1
  • 1
Dane Lowrey
  • 170
  • 1
  • 10