This page will describe how to get started with the A.S.K. Responder. Unsure of what this is all about? Please see our blog post announcing the A.S.K. Responder.
Setting up the Responder
Easy Mode
NOTE: "Easy Mode" is not working at the moment due to an issue with the way Alexa beta setup works. Please use the normal "advanced" setup flow.
Easy mode allows you to skip most of the setup and use our default implementation as a "beta tester". In so doing, however, you also lose the flexibility of working with your own intent schema. If you just want to play around with the utility, though, and don't care about storing multiple concurrent responses, this is a great choice. All you have to do is self-register in the Alexa skill store with this link. You should see something that looks like this:
Once you accept, just wait 30 seconds or so, and you're good to go. You can skip down to the "Using the skill" section!
Advanced Mode
The first thing we need to do is set up the A.S.K. Responder skill for the developer account to your Alexa account. Unfortunately this is not as simple as merely activating an existing skill. Because this is an Alexa dev tool there is no way it can be certified for use by the public. Therefore you will need to manually configure the settings. Don't worry, it's actually quite simple:
1.) Sign-in to your Alexa dev account
https://developer.amazon.com/edw/home.html#/skills/list
This will take you to a list of your personal developer skills.
2.) Create a new skill
Click the "Add a New Skill" button in the upper right. This should take you to a new page that prompts you to fill out a bunch of information about this new skill. There are 6 tabs. We're going to go through them one at a time and fill them in.
3.) Fill in the "Skill Information" tab
It will assign you a random Application Id. Don't worry about it. This instance of this skill is entirely local to your account only.
1.) Sign-in to your Alexa dev account
https://developer.amazon.com/edw/home.html#/skills/list
This will take you to a list of your personal developer skills.
2.) Create a new skill
Click the "Add a New Skill" button in the upper right. This should take you to a new page that prompts you to fill out a bunch of information about this new skill. There are 6 tabs. We're going to go through them one at a time and fill them in.
3.) Fill in the "Skill Information" tab
It will assign you a random Application Id. Don't worry about it. This instance of this skill is entirely local to your account only.
Field |
Value |
Skill Type |
Custom Interaction Model |
Name |
Responder |
Invocation Name |
responder |
Audio Player |
No |
Enter these values, then hit "Save".
4.) Fill in the "Interaction Model" tab
We have two things to fill in here, the Intent Schema, and the Sample Utterances. There are no Custom Slot Types for this skill.
4.) Fill in the "Interaction Model" tab
We have two things to fill in here, the Intent Schema, and the Sample Utterances. There are no Custom Slot Types for this skill.
Interaction Model | |
Intent Schema | { "intents": [ { "intent":"GETRESPONSE", "slots": [] }, { "intent": "WHATISMYID", "slots": [] }, { "intent": "AMAZON.HelpIntent", "slots": [] } ] } |
Sample Utterances | GETRESPONSE what is my response GETRESPONSE to get the response GETRESPONSE to get my response GETRESPONSE to give the response GETRESPONSE to give me my response GETRESPONSE to play the response GETRESPONSE to play my response GETRESPONSE to play GETRESPONSE to open the response GETRESPONSE to open my response GETRESPONSE to open WHATISMYID what is my id WHATISMYID give me my id WHATISMYID to give me my id |
Enter these values, then hit "Save".
5.) Fill in the "Configuration" tab
Select the "AWS Lambda ARN (Amazon Resource Name)" option. Then fill in the following ARNs for whatever regions you want your skill to function in.
5.) Fill in the "Configuration" tab
Select the "AWS Lambda ARN (Amazon Resource Name)" option. Then fill in the following ARNs for whatever regions you want your skill to function in.
Region |
ARN (Amazon Resource Name) |
North America (NA) |
arn:aws:lambda:us-east-1:413543783734:function:ASK_Responder |
European Union (EU) |
arn:aws:lambda:eu-west-1:413543783734:function:ASK_Responder |
Account Linking should be set to no.
6.) You've finished setting up the skill
I told you it wouldn't be so bad. The remaining 3 tabs (Test, Description, and Publishing Information) don't require any input to get this skill working locally for you.
6.) You've finished setting up the skill
I told you it wouldn't be so bad. The remaining 3 tabs (Test, Description, and Publishing Information) don't require any input to get this skill working locally for you.
Using the skill
Alright, so now that you've successfully created the skill for your Amazon account, it's time to get started with mocking skill responses.
1.) Register your Echo
Activate the skill so the server will record your Echo ID and give it back to you. Talk to your Echo and activate the skill:
"Alexa, open Responder"
It should then respond with your Echo ID, and a series of instructions on how to use it. Your ID is a unique identifier that will look something like this (0fabacdd-d3ea-48a7-98bc-7d518a19b7c1). You will want to copy/paste it out of your Alexa App so you can use it later. Remember, if at any time you forget what your ID is, you can always ask the skill
"Alexa, ask Responder what is my id?"
2.) Register a Mock Response
To register a mock service response you need to POST a JSON payload to the following endpoint:
http://responder.3po-labs.com/responder/users/{yourId}/
For our example purposes this would look like:
http://responder.3po-labs.com/responder/users/0fabacdd-d3ea-48a7-98bc-7d518a19b7c1/
The POST body needs to contain a JSON payload that Amazon can consume. Right now this means SpeechletResponseEnvelope as defined in the Alexa Skills Kit. Here is an example SpeechletResponseEnvelope:
1.) Register your Echo
Activate the skill so the server will record your Echo ID and give it back to you. Talk to your Echo and activate the skill:
"Alexa, open Responder"
It should then respond with your Echo ID, and a series of instructions on how to use it. Your ID is a unique identifier that will look something like this (0fabacdd-d3ea-48a7-98bc-7d518a19b7c1). You will want to copy/paste it out of your Alexa App so you can use it later. Remember, if at any time you forget what your ID is, you can always ask the skill
"Alexa, ask Responder what is my id?"
2.) Register a Mock Response
To register a mock service response you need to POST a JSON payload to the following endpoint:
http://responder.3po-labs.com/responder/users/{yourId}/
For our example purposes this would look like:
http://responder.3po-labs.com/responder/users/0fabacdd-d3ea-48a7-98bc-7d518a19b7c1/
The POST body needs to contain a JSON payload that Amazon can consume. Right now this means SpeechletResponseEnvelope as defined in the Alexa Skills Kit. Here is an example SpeechletResponseEnvelope:
{ "version": null, "response": { "outputSpeech": { "type": "SSML", "id": null, "ssml": "<speak>This is the voice played through the Echo speakers</speak>" }, "card": { "type": "Simple", "title": "This is the text displayed visually in the Alexa App's title", "content": "This is the text that is visually displayed in the Alexa app." }, "reprompt": { "outputSpeech": { "type": "SSML", "id": null, "ssml": "<speak>This is the delayed verbal prompt read to the user</speak>" } }, "shouldEndSession": false }, "sessionAttributes": null }
To send a POST request to the A.S.K. Responder skill, you'll need to use a program like Postman (Chrome plugin) or cURL.
Note: You must set the header "Content-Type" equal to "application/json" when sending the POST request.
If it successfully registered your response it should repeat it back to you. To see what your current registered response is, you can use this endpoint:
GET http://responder.3po-labs.com/responder/users/{yourId}/
3.) Getting the Echo to play your mock response
Simply access your response through your Echo:
"Alexa, open Responder" or "Alexa, ask Responder to play my response"
This will then play your response directly through your Echo, exactly as if there was a skill on the back-end delivering your response as a reply.
Note: You must set the header "Content-Type" equal to "application/json" when sending the POST request.
If it successfully registered your response it should repeat it back to you. To see what your current registered response is, you can use this endpoint:
GET http://responder.3po-labs.com/responder/users/{yourId}/
3.) Getting the Echo to play your mock response
Simply access your response through your Echo:
"Alexa, open Responder" or "Alexa, ask Responder to play my response"
This will then play your response directly through your Echo, exactly as if there was a skill on the back-end delivering your response as a reply.
Example Echo Responses (for reference)
You probably don't have the Alexa service response formats memorized... yet. So here are some fully functional examples that you can play with. Just POST them to your Echo ID to get started.
Simple card
{ "version": null, "response": { "outputSpeech": { "type": "SSML", "id": null, "ssml": "<speak><phoneme alphabet=\"ipa\" ph=\"kɒmplIbɒt\"> CompliBot </phoneme> thinks you're great!</speak> " }, "card": { "type": "Simple", "title": "What does CompliBot think of you?", "content": "CompliBot thinks you're great!\nLearn more at: http://www.derpgroup.com/bots" } }, "sessionAttributes": null }
Standard card (Images)
{ "version": "1.0", "response": { "outputSpeech": { "type": "SSML", "ssml": "<speak>Hi! My name is <phoneme alphabet=\"ipa\" ph=\"kɒmplIbɒt\"> CompliBot </phoneme>!</speak> " }, "card": { "type": "Standard", "title": "CompliBot says hello", "text": "Hi! My name is CompliBot!\nLearn more at: http://www.derpgroup.com/bots", "image": { "smallImageUrl": "https://s3-us-west-2.amazonaws.com/derpgroup/public/CompliBot_image_720x480.jpg", "largeImageUrl": "https://s3-us-west-2.amazonaws.com/derpgroup/public/CompliBot_image_1200x800.jpg" } } } }
session attributes & Reprompts
{ "version": "1.6.3", "response": { "outputSpeech": { "type": "SSML", "ssml": "<speak>Would you like pepperoni on your pizza?</speak>" }, "card": { "type": "Simple", "content": "Would you like pepperoni on your pizza?", "title": "Domino's confirmation" }, "reprompt": { "outputSpeech": { "type": "SSML", "ssml": "<speak>Please confirm if you'd like pepperoni by saying <break/> yes <break/> or no</speak>" } }, "shouldEndSession": false }, "sessionAttributes": { "shoppingCart": [ { "item": 1, "itemType": "pizza", "size": "large", "toppings": [ "mushrooms", "onions" ] }, { "item": 2, "itemType": "pizza", "size": "large", "toppings": [ "pineapple", "ham" ] } ] } }
Bonus ascii art fun in a card
I don't want to admit how long it took to experimentally tweak and adjust this card to get it to display things properly. But that's exactly what the A.S.K. Responder is for. Lots of small rapid adjustments for testing.
{ "version": "1.0", "response": { "outputSpeech": { "type": "SSML", "ssml": "<speak>You're absolutely purrfect right meow.</speak> " }, "card": { "type": "Standard", "title": "CompliBot compliment", "text": "You're absolutely purrfect right meow.\n \n /\\____/\\ \n /` '\\ \n====0 0====\n \\ ---- /\n / \\ \n / \\ \n| |\n \\ || || /\n \\_oo___oo__/#########o", "image": { "largeImageUrl": "https://s3-us-west-2.amazonaws.com/derpgroup/public/kitten.jpg" } } } }