In the previous exercise you saw that Option 2 (using Entity Resolution) is faster and easier to maintain. Where can you access these synonyms? In the JSON request.

About JSON Request

When users interact with your skill, Alexa sends off a JSON request to your AWS Lambda function that looks something like the text file — request.js shown on the right. If your skill uses entity resolution, the JSON request includes some additional important information, including the synonym Alexa heard, the status code of the resolution, and the resolved value.

In Node, we can access the synonym using:


Where YOUR_SLOT_NAME is the desired slot.

We can access the status code using:


We can access the resolved value using:




Let’s do a little bit of practice with a sample JSON request.

Because this is a reserved word in JavaScript, we’ve setup main.js so you can omit this, and start with event.

Using console.log(), print the synonym in the JSON request.


Using console.log(), print the status code in the JSON request.


Using console.log(), print the resolved value in the JSON request.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?