Archive

Editor’s note: This tutorial is out of date. You can view the most recent tutorial here.

Programming for the Alexa platform is a new paradigm for everyone. Creating a solid Voice User Interface (VUI), understanding the Alexa platform, how to interact with it and certifying your skill all need to be mastered in addition to actually programming your skill in Node.js, Python, Java or whatever your favorite language may be.

This post attempts to walk the first time Alexa skills developer through the steps involved in creating a solid skill that can actually be submitted for certification. Understanding the scope of what is involved while using a cut/paste approach to the programing required should enable you to grasp the parts involved and how they all fit together. Nothing is better for learning a thing than actually doing a thing – let’s get started!

We are going to take a reference skill called ‘Reindeer Games’, a trivia game popular on the Alexa platform, and adapt it by creating a trivia game of your own to submit for certification. The framework has all of the business logic, use-cases, error handling and help functions already implemented – you just need to plug in your own question/answers and edit a couple lines of script.

Important: Follow the instructions below which step you through setting up the Framework Trivia Game, ‘Reindeer Games’ – be sure you have this working before you move on to adapting it to your set of questions.

In the Test tab we are going to enter a sample utterance in the service simulator tab.

In this example we have called the skill ‘reindeer games’ – This is the ‘Invocation Name’ we setup on the Skill Information line in step #2.

Enter ‘open reindeer games’ and select Ask.

You should see the formatted JSON request from the Alexa Service and response coming back.

Assuming your Echo device is on-line (and logged in with the same account as your developer account) you should now see your skill enabled in the Alexa Companion app and be able to ask Alexa to launch your skill!

Not working (invalid response)?

Do you have the right ARN copied from your Lambda function into your Developer Portal / Skill?

Are you calling the right invocation name?

Are you saying Launch, start or open?

Are you sure you have NO other skills in your accounts with the same invocation name?

For this Framework specifically you need to have a minimum of 7 questions/answers for the business logic to function.

Step#4 – Make it Yours

1. Edit the Skill Information to reflect your new trivia Game

A new Name

A cool Invocation Name

A fun icon

Everything else can stay as is for now in the Developer Portal

2. Log back into your AWS console and edit the Trivia Game Function you have already created. We are going to copy in your new trivia game questions and answers.

As we have elected to edit our code in-line you just need to edit the questions and answers JSON to reflect your trivia game. A few suggestions:

Note than the format calls for one question and 4 answers for each question. The first answer is the correct answer. The script logic takes care of randomizing the questions and answers for you.

In your AWS lambda function find the applicationId section and copy YOUR Application ID into the section indicated (do not copy the ID below, which is just an example) - It looks something like this when you are done: (be sure to SAVE)

// Route the incoming request based on type (LaunchRequest, IntentRequest,

// etc.) The JSON body of the request is provided in the event parameter.

4. Be sure to remove any Reindeer questions (kind of goes without saying)

5. A minimum of 20 questions is needed to get started, about 100 is a good number to keep users engaged – the more the better.

6. Be sure to select SAVE when you are all done. Note we test in the Developer portal, not in our Lambda function (AWS).

7. Now we need to go back to our Developer Portal and test and edit our skill and we will be GO for certification.

a. In your skills Test tab, enter your Utterances to make sure everything is working with your new questions and answers.

b. Go ahead and test with your Alexa enabled device to make sure everything sounds right, you may find a few words that need to be changed for a better user experience.

<IMPORTANT>

Actually run your skill on an Echo device and test every intent and question – the certification team will do this, and you will FAIL certification if you have any issues.

* Does every question and answer sound correct? Do you need to change any words to make them sound correct?

* Have you added in YOUR ApplicationID as per the previous instruction?

c. Select the Description tab next

i. Spend some time coming up with an enticing, succinct description. This is the only place you have to attract new users. These descriptions show up on the Companion Apps list of new skills available.

ii. Be sure you have the rights to whatever icons you are uploading – you will need to provide both 108x108px and 512x512px images. If there is any question the certification team will fail your submission.

b. Note in your testing instructions that you are using the Trivia Game Framework.

c. You will receive progress e-mails and possibly other suggestions from the team on how you can make your skill even better. You can update your skills at any time.

Alexa Developer Skill Promotion

We are offering a free Alexa Dev T-shirt to developers who publish an Alexa skill by April 30, 2016. Quantities are limited. To be eligible for this promotion, you must fill out this form. See the complete terms and conditions here.