Jordan Kasper
Simple `POST` webhooks over HTTPS using JSON paylods
What user's will "invoke" to hit your app.
For example:
"Alexa, ask connect tech where the after party is Friday"
Must be multiple words,
no copyright infringing,
no proper names,
no confusion with built-in skills,
...
Read the Alexa Documentation!
What is the user trying to do?
And what data does the app need to do it?
{
"intents": [
{
"intent": "StopIntent"
},
{
"intent": "Schedule",
"slots": [
{
"name": "Day",
"type": "AMAZON.DATE"
}
]
}
]
}
Where is this file?
Copied and pasted into the developer portal.
(Under "Interaction Model")
ಠ_ಠ
{
"intents": [
{
"intent": "FavoriteColor",
"slots": [
{
"name": "Color",
"type": "COLOR_SLOT"
}
]
}
]
}
red
orange
yellow
green
blue
violet
black
white
navy blue
royal purple
Where in my code do I put those values?
Copy and paste them into the developer portal.
(Under "Interaction Model")
ಠ_ಠ
Add a "config" directory to your application:
There is a 50,000 entry limit across ALL slots in your skill!
Alexa, ask connect tech where the after party is Friday
Alexa, ask connect tech where Friday's party is
Remember your intents!
{
"intent": "Schedule",
"slots": [
{
"name": "Day",
"type": "AMAZON.DATE"
}
]
}
IntentName the phrase with any {SlotNames} embedded
Schedule about the after party on {Day}
Schedule when the after party is on {Day}
Schedule about {Day} after party
Schedule when {Day} party is
...
Where do I put these?
Copy and paste them into the developer portal.
(Under "Interaction Model")
ಠ_ಠ
(There is a ~200,000 character limit.)
Doesn't matter!
So long as you can accept POST requests over HTTPS.
Just use a library:
{
"session": { ... },
"request": { ... },
"version": "1.0"
}
"session"
{
"session": {
"sessionId": "SessionId.6a4789.....",
"application": { "applicationId": "amzn1.ask.skill.2ec93....." },
"attributes": {
"someSessionDataThing": "jordan"
},
"user": { "userId": "amzn1.ask.account.AFP3ZWK564FDOQ6....." },
"new": true
},
"request": { ... },
"version": "1.0"
}
"request"
{
"session": { ... },
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.ba6dbc3f.....",
"locale": "en-US",
"timestamp": "2017-09-21T09:15:27Z",
"intent": {
"name": "Schedule",
"slots": {
"Day": { "name": "Day", "value": "2017-09-22" }
}
}
},
"version": "1.0"
}
{
"session": { ... },
"request": {
"type": "IntentRequest",
...
},
"version": "1.0"
}
No explicit intent
Example: "Alexa, launch connect tech"
Think about what you should say back!
User cancels action, times out, or there is an error.
Your skill app MUST NOT RESPOND to this request... at all.
ಠ_ಠ
AudioPlayer
and PlaybackController
requests
(I don't know much on those, so we'll move on.)
{
"version": "1.0",
"response": { ... },
"sessionAttributes": {
"someSessionDataThing": "jordan"
}
}
{
"version": "1.0",
"response": {
"outputSpeech": { ... },
"card": { ... },
"shouldEndSession": true
},
"sessionAttributes": { ... }
}
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "SSML",
"ssml": "The party is on at 7:30 p.m. ! "
},
"card": { ... },
"shouldEndSession": true
},
"sessionAttributes": { ... }
}
Speech Synthesis Markup Language
(a w3c rec from 2004)
Read Amazon's docs on it.
(You can also use "PlainText")
<speak>
(root)<emphasis level="strong">
<audio src="...">
(some restrictions)
<br time="2s">
<phoneme alphabet="ipa" ph="pɪˈkɑːn">pecan</phoneme>
<say-as interpret-as="cardinal">5</say-as>
("five")
<say-as interpret-as="ordinal">5</say-as>
("fifth")
{
"version": "1.0",
"response": {
"outputSpeech": { ... },
"card": {
"title": "Friday After Party",
"text": "This is going to be cray cray",
"image": {
"smallImageUrl": "https://s3.amazonaws.com/connect-tech/party.png",
"largeImageUrl": "https://s3.amazonaws.com/connect-tech/party.png"
},
"type": "Standard"
},
"shouldEndSession": true
},
"sessionAttributes": { ... }
}
(Dialogs/Conversations, AudioPlayer, Echo Show, Smart Home skills, Reprompts, ...)