On this page
Amazon Echo - Alexa integration
See Alexa for the contributed module. In this basic example we will create an Alexa Skill that you will be able to invoke from your Echo by saying "Alexa, ask hello drupal from New York City" and Alexa will respond "Hello Drupal to New York City".
There is extensive documentation on how your interaction model should look like for Alexa Skills, please see that: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/get...
There are minimal prerequisites for your application:
- Your site has to be accessible online - Amazon will be sending callbacks to a URL on your site.
- It has to use SSL, only HTTPS callbacks are allowed.
The steps are:
Create an Amazon application
Go to https://developer.amazon.com and sign in with your Amazon account
Click Alexa
Choose Alexa Skills Kit and add a new skill, call it Hello Drupal, and fill in the form:
- For Skill Type, choose Custom Interaction Model
- For Invocation name, use a short phrase of your choice such as my application
- On the Interaction Model tab
- put in Intent Schema from this file: sample_intents.json
- put in Sample Utterances from this file: sample_utterances.txt
- On the Configuration tab
- put in https://your.site/alexa/callback as your Endpoint
- choose No for Account linking
- On the SSL Certificate tab, choose what kind of SSL certificate is your site using
- Save the configuration
- Write down the Application Id back on the original Skill information screen
Integrate with Drupal
- Download the module and run Composer installation for the Alexa library:
composer require jakubsuchy/amazon-alexa-php. You should run this command from wherever your composer.json for Drupal is. - Enable Alexa Webhook module
- Enable Alexa Demo module
- Go to Config -> Alexa and put in the Application Id you noted from previous steps
Test
If you have Amazon Echo and it's linked to the same Amazon account you used when developing this skill you can now say Alexa, ask {your app invocation name} hello drupal from New York City
If you don't have Amazon Echo yet or you want to keep testing quickly, go to the Amazon Developer console and you can send custom commands on the Test tab. Type "help" and play. You should receive a response back that looks like this:
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "You can ask anything and I will respond with \"Hello Drupal\""
},
"shouldEndSession": false
},
"sessionAttributes": {}
}Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion