For the team's 2016 Christmas present Alick brought everyone an Amazon Echo Dot, and then we all used the devices as the basis for our Christmas hack day, right before our annual office party.
During the day we got 6 prototype skills under way, some of which we've got a few video clips of working, which you'll find links for below. You can also find a link here to a video which shows all of them working, as well as a few interviews with team members around the challenges they faced over the day.
Prior to the hack day, I put together an overview of how to create a skill for the rest of the team to work from, which you can see in the section below 'create your Amazon skill'.
The prototypes we worked on were as follows.
- Latest offers on Ski Safari
- What's on at LAMDA
- Latest from the Travel Nation blog
- Latest films from Picturebox films
the main challenges
The main challenges we hit over the day were:-
- HTTPS. For us to pull data from staging environments running client's Drupal websites we needed those staging sites to have valid SSL certificates, which in most cases wasn't the case.
- Getting Alexa to recognise people's real names or usernames
- Pulling text as plain text from Drupal
- A Composer dependancy meant using the Alexa Drupal module wasn't as easy as we'd hoped, so that might be an area we look to help contribute more to in the future.
Next steps for us with Skills development are as follows:-
- Take some of these prototypes to fully live versions
- Think about what other data sources we can integrate with
create your Amazon skill
Go to https://developer.amazon.com and sign in with your Amazon account. Click on the Alexa menu tab and choose Alexa Skills Kit. Add a new skill on the top right.
Name it miggle example, and fill in the form
For Skill Type, choose Custom Interaction Model
For Invocation name, use a short phrase of your choice such as miggle ;)
Put in Intent Schema. You can find an example schema in the example directory of this project
Learn more about the intent schema
Put in Sample Utterances. You can find example utterances in the example directory of this project
Learn more about utterances
put in the URL of your endpoint.
choose No for Account linking
Choose the relevant option, if you've used Letsencrypt select the first option.
Click save and note down the ID displayed above the configuration form
coding your skill with Silex
Before starting you may want to look at the Silex documentation
Also take a look at the documentation for the Alexa PHP library
Back in the Amazon console, edit your skill and click on the Testing tab. Here you can simulate the requests that Alexa will send to your endpoint.
Make sure that you have the skill enabled for testing on your account, this will allow you use the skill on your Echo device.
Head down to the Service Simulator and try out some Utterances.
Even if you haven't set up your Silex app yet you can still test the skill and see what sort of request you will be expecting from Alexa.
get stuck in
Clone the example repository:
git clone [email protected]:miggle/alexademo.git alexa
Change directory into the repo and remove the current remote
git remote remove origin
- Add your own git remote:
git remote add origin [email protected]:name/repo
git push origin master -u
- Pull down the dependencies with composer:
- Update the
/alexaroute once your ready to create your own skill
- Make sure you add your app ID. You'll find this at the top of the configuration forms in the Amazon developer console.
testing your live skill
Now you can deploy your code live it's easy to test your work through a number of means.
This was mentioned before, in the skill setup on https://developer.amazon.com there is a Testing tab when configuring a skill. Here you can simulate how the skill acts on specific utterances.
Echosim.io is a community created Echo simulator, it's similar to the Amazon simulator but allows you to test utterances via a microphone input instead of typing the phrase.
the Echo itself!
You will need to ensure that you have the skill enabled for testing on your account.
testing your skill locally
Postman is a popular app to help test your endpoints, you will need to setup a self sign certificate on your local environment and tell Postman not to verify the SSL in the settings.
If you want to take back control of your web sites and applications then get in touch with miggle to see how we can deliver operational freedom for you in Drupal.