{{announcement.body}}
{{announcement.title}}

Build a Skill for Amazon Alexa

DZone 's Guide to

Build a Skill for Amazon Alexa

Many developers are contributing to the Alexa platform to build “Alexa Skills” — this article teaches you how to make your own Alexa skills!

· IoT Zone ·
Free Resource

amazon alexa

Build your own skills for Alexa!

Amazon's Alexa is one of the most popular Voice Assistants available. Many developers are contributing to the Alexa platform to build “Alexa Skills”. These skills help to expand Alexa's capabilities.

In return, Amazon is offering some perks to the developers to encourage them to build skills. https://developer.amazon.com/alexa-skills-kit/alexa-developer-skill-promotion-india

You can get an “Alexa T-shirt” and $100 free “AWS credit” every month for 12 months.

You may also like: Developing Alexa Skills With Spring Boot REST Services in Mind

Let’s get started and try to build a skill for Alexa. We will be calling it “NASA facts”. You can use these techniques to build skills of your own!

Create a Fact Skill First

Visit this link https://developer.amazon.com/alexa/console/ask/. You will see an “Alexa Developer Console” dashboard.

Click on the “Create Skill” button.

Enter the Skill name and language. Select the “Custom” model to add to your skill.

Select  " Alexa Hosted ( Node.js )".

alexa skill dashboard

Choose " Fact Skill" from template options.

skill dashboard


Now you will see a dashboard where we are going to build, test and deploy our Alexa skill.

We have to do some modifications to our NASA facts.

Change the Facts Data

Got to the “Code” tab and open the “languageStrings.js“.

code snippet

Change the FACTS list elements.

code snippet

The facts are available from lines no. 21 to 25. Remove these facts and add your facts. Use Google to find out the facts. These are the facts I have added. Just copy and paste the below facts if you are trying the same tutorial.

“NASA, or the National Aeronautics and Space Administration, was created by President Dwight Eisenhower in 1958 in response to the Soviet Union’s launch of the first artificial satellite the previous year.”

“President John F. Kennedy gave NASA the goal of sending a man to the moon by the end of the 1960s. On July 20, 1969, the first men walked on the moon as part of the Apollo 11 mission.”

“Twelve men have walked on the moon, all during the Apollo missions.”

“In 1970, the Apollo 13 lunar landing was aborted after an oxygen tank exploded.”

“The space shuttle Enterprise was the first shuttle built for the reusable spacecraft fleet, though it was created for testing and never flew in space.”

“Enterprise was initially to be named Constitution, but fans of the TV show Star Trek ran a successful write-in campaign to change the name.”

“The space shuttle program has had more than 120 successful flights but also two disasters in which the shuttles and crews were lost (Challenger in 1986 and Columbia in 2003).”

“Within the next year and a half, the 51-year-old agency is slated to finish construction of the international space station and retire the three remaining shuttles — Atlantis, Discovery, and Endeavour.”

“Space shuttle Endeavour was built using spare parts from Discovery and Atlantis.”

“The next generation of spacecraft won’t be ready until 2015, so U.S. astronauts will travel with the Russians aboard their Soyuz spacecraft to visit the space station."

Source: https://www.usnews.com/news/national/articles/2009/06/01/10-things-you-didnt-know-about-nasa.

code snippet

Edit the fact name and other strings in the file as required.

Click “Save” to save your changes.

Click on the “Deploy” button to deploy the changes.

Finally, edit the Invocation and GetNewFactIntent utterances.  Just replace the space facts with “my amazing NASA facts” in the GetNewFactIntent.

alexa dashboard

Click the “Save model” and “Build Model”. Once it is built, you can test in the simulator.

P.S. please build first to test.

That’s it. You are done building your skills.

Let’s Test

Enable the test. Type  “ask my amazing NASA facts” in the textbox and hit enter.

alexa dashboard

You are done building your first Alexa Skill.

Build your logo and publish your skill on the Alexa Skills store.

Once you are done with that, submit for review. When your skill becomes live. Fill up this form to be eligible for the Alexa promotion offer.

Amazon Alexa Developer Shirt – India Edition
_Developers in India who publish an Alexa skill can be eligible to get a free, limited-edition Alexa dev shirt_developer.amazon.com

This is a link for Indian developers.

Select your country on the same page.

Thank you for reading!


Further Reading

Smart Home Tutorial: ESP8266, Alexa, and Amazon Echo

Eavesdropping With Amazon Alexa

Developing Location-Aware Alexa Skills

Topics:
conversational ai ,alexa skill ,alexa skill development ,tutorial ,iot ,voice recognition

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}