Learn
Build Your First Alexa Skill
Test Simulator

Now that we have tested our skill in Echosim.io and got a response back from Alexa, let’s break down what actually happened.

The interactive test simulator on the right will help us understand the process of requests and responses.

  1. In the text box labeled Enter an utterance, type “tell {YOUR-FIRST-NAME} {LAST-INITIAL}’s code academy hello”.
  2. Click Enter.

How it Works


  1. When we said “tell {YOUR-FIRST-NAME} {LAST-INITIAL}’s code academy hello”, our speech was sent to Alexa in the cloud.
  2. Alexa used Automatic Speech Recognition (ASR), and Natural Language Understanding (NLU) technologies to parse our speech, matching it to HelloIntent.
  3. It then sent a request in the form of a JSON object, as shown in the JSON Input box. If you can understand JavaScript objects in a program, then you can read JSON similarly (JSON stands for JavaScript Object Notation). The request includes the intent to our Lambda function. In our case, the JSON request includes the HelloIntent. (Scroll down to see this.)
  4. Our Lambda function received the request and responded to Alexa with another JSON object, which included the output speech “Hello Codecademy” in text format. You can see that JSON response in the JSON Output box.
  5. Using this response, Alexa replies correctly to our request.

Instructions

Type “tell {YOUR-FIRST-NAME} {LAST-INITIAL}’s code academy hello” in the mock simulator, and read through the request and response. Both the request and the response are formatted as JSON.

Notice, the request includes something like:

"request": { "type": "IntentRequest", "requestId": "amzn1.echo-api.request.xxxx", "timestamp": "2018-09-20T15:47:45Z", "locale": "en-US", "intent": { "name": "HelloIntent", "confirmationStatus": "NONE" } }

The utterance “tell {YOUR-FIRST-NAME} {LAST-INITIAL}’s code academy hello” triggered a request that references the HelloIntent.

Folder Icon

Take this course for free

Already have an account?