Alexa Developer Console Setup
- Open the Alexa Developer Console
- Select an existing skill or create a new skill. For a new skill:
a. Select Custom for your model.
b. Select Provision your own for your skill's backend resources.
c. Select Hello World Skill. - Make sure you're on the Build tab.
- Select the Invocation menu item and specify a unique invocation in
Skill Invocation Name form. - Click Save Model.
Interaction Model & Webhook Setup
Interaction Model
First you need to setup your skill's Interaction Model to allow Alexa to
send user utterances to the Meya webhook.
Under the Build tab, select Interaction Model > JSON Editor.
Then copy the following JSON object and paste it into the JSON editor
(make sure the invocationName is set correctly):
{
"interactionModel": {
"languageModel": {
"invocationName": "YOUR_INVOCATION",
"intents": [
{
"name": "CatchAll",
"slots": [
{
"name": "any",
"type": "AMAZON.Person"
}
],
"samples": [
"{any}"
]
},
{
"name": "AMAZON.CancelIntent",
"samples": [
"cancel"
]
},
{
"name": "AMAZON.HelpIntent",
"samples": [
"i need help",
"help me",
"help"
]
},
{
"name": "AMAZON.StopIntent",
"samples": [
"stop"
]
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples": [
"reset",
"go home",
"restart"
]
}
],
"types": []
}
}
}
- Click the Save Model button.
- Click Build Model. Alexa will start training the Interaction Model.
Webhook Setup
1. Add the Alexa Integration
The first thing you need to do is add the Alexa integration to your app,
you do this by creating a YAML file in your app that specifies the Alexa
integration element.
Here is an example: save the following YAML to a file called alexa.yaml
in your app's integration/
directory:
type: meya.amazon.alexa.integration
skill_id: (@ vault.alexa.skill_id )
Properties:
- id: this is optional, if you do not provide this then the id of the
integration will be the dot path of the YAML file e.g.
integration.alexa
. - skill_id: this is the Skill ID that was assigned when you first
created the skill. In this case we saved the Skill ID in the apps' vault.
You can find the Skill ID under the Build > Endpoint section.
Next you need to get the Skill ID and add it to the app's vault:
- Download you app's vault file:
meya vault download --file vault.secrets.yaml
- Get the Skill ID from the Alexa Developer Console:
a. Go to Build > Endpoint
b. Select AWS Lambda ARN
c. Copy the Skill ID - Add the
alexa.skill_id
key to thevault.secrets.yaml
file. Paste the
Skill ID as the value of thealexa.skill_id
key. - Upload the app's vault file:
meya vault upload --file vault.secrets.yaml
- Push your app:
meya push
2. Get Your Webhook URL
Next you need to run meya webhooks
to get a list of webhooks for all the
integrations you've added to your app. Search for Alexa webhook
and copy the webhook URL.
3. Setup the Skill's Endpoint
- Go to the Build tab in the Alexa Developer Console.
- Go to the Endpoint section.
- Select the HTTPS option.
- Paste the webhook URL in the Default Region form.
- Select the My development endpoint has a certificate from a trusted
authority option for the Select SSL certificate type drop down
form. - Click Save Endpoints.
Test Your Integration
First make sure you've pushed your latest app changes to ensure the Alexa
integration is loaded.
meya push
- Select your skill in the Alexa Developer Console.
- Click on the Test tab.
- Make sure you enable testing by selecting Develop in the drop down.
- Initiate the conversation with saying or typing your invocation.
Element details
type: meya.amazon.alexa.integration
class: AlexaIntegration
path: /meya/amazon/alexa/integration/integration.py
signature: -
Fields
field | description | required | signature | default | type |
---|---|---|---|---|---|
spec | Override the original spec for this element. | ○ | ○ | null | Spec |
enabled | Enables the integration, allowing it to process events and HTTP/WS entries. | ○ | ○ | true | bool |
filter | Specifies the GridQL to filter rx_sub , rx , tx , tx_pub entries. Check the integration filtering guidefor more info. | ○ | ○ | rx_sub: true rx: true tx: true tx_pub: true | IntegrationFilter |
verify_token | The token to be verified for each incoming request. You need to add the verify_token=YOUR_TOKEN query parameter to integration's webhook URL. | ○ | ○ | null | str |
max_attachment_size | Controls maximum attachment size supported by the integration in bytes. | ○ | ○ | null | int |
markdown | The markdown features that are supported by this integration. Check the Markdown guide for more info. | ○ | ○ | false | list bool |
typing | When set to false , all typing indicators received by the integration will be ignored. | ○ | ○ | true | bool |
skill_id | ◉ | ○ | str | ||
catch_all_intent_name | ○ | ○ | "CatchAll" | str | |
unhandled_intent_text | ○ | ○ | "Sorry I could not help with that. Please try again." | str | |
Usage reference
Basic
type: meya.amazon.alexa.integration
skill_id: STRING
Full
type: meya.amazon.alexa.integration
spec:
type: STRING
data:
STRING: ANY
timeout: 123
trigger_when: ANY
enabled: false
filter:
rx_sub: STRING
rx: STRING
tx: STRING
tx_pub: STRING
verify_token: STRING
max_attachment_size: 123
markdown:
- format|linkify|breaks|typographer
typing: false
skill_id: STRING
catch_all_intent_name: STRING
unhandled_intent_text: STRING