Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

APIs Build an Alexa Skill Building an Alexa Skill Creating an Intent Schema

I have no idea what this code says and what it does, Can someone help me i literally have No idea.

In the teachers notes i tried and i revised the code over and over again and there is nothing that i could understand, I Have no idea

Steven Parker
Steven Parker
218,596 Points

Share your code here to make it possible for someone to analyze the issue and give you an answer.

Be sure to use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down:   Or watch this video on code formatting.

You can also make a snapshot of your workspace and post the link to it here.

Here's The Code Steven,

{

"intents": [

{

  "intent": "GetDefinition",

  "slots": [
    {

      "name": "Term",

      "type": "LIST_OF_TERMS"

    }

  ]

},

{

  "intent": "AMAZON.HelpIntent"

},

{

  "intent": "AMAZON.StopIntent"
},

{

  "intent": "AMAZON.CancelIntent"
}

] }

1 Answer

Steven Parker
Steven Parker
218,596 Points

This intent schema, along with some other parts that will be covered in later videos, defines what the skill will do. This section mostly just gives names to the other parts. Perhaps this breakdown will help:

{                                       
  "intents": [                          <-- list of what this skill will do
    {                                   
      "intent": "GetDefinition",        <-- the name of the first one
      "slots": [                        <-- things to listen for
        {                               
          "name": "Term",               <-- name of the first thing
          "type": "LIST_OF_TERMS"       <-- what kind of thing it is
        }                               
      ]                                 
    },                                  
    {                                   
      "intent": "AMAZON.HelpIntent"     <-- something else the skill will do
    },                                      these are all built-ins that
    {                                       need no slot definitions
      "intent": "AMAZON.StopIntent"     
    },                                  
    {                                   
      "intent": "AMAZON.CancelIntent"   
    }                                   
  ]                                     
}                                       

Does that make it clearer?

Yes thank you, Steven