API Conventions for Alexa Conversations

Alexa Conversations elements, such as annotated dialogs and response templates, use the following conventions.

Naming conventions

Variable and type names can start with a letter or an underscore, and can be composed of any alphanumeric characters, as well as the underscore (_) and hyphen (-). To maintain readability and consistency, Alexa Conversations adheres to the following convention for the naming of variables, types and members of types, and response templates within our example mark-up use cases. This convention isn't mandatory.

  • camelCase for variables/arguments
  • PascalCase for types
  • _camelCase for type members/properties

Referencing variables in conversations

Annotated dialogs use the following operators to reference variables from the current dialog state and to guide the Alexa Conversations model to select the correct values for API calls.

  • The dot operator (.) is the separator for accessing the properties of a custom slot type.
  • Brackets ([]) with an index indicate a particular element of a list. The index of the first element of the list is 0. For example, $items[0]._quantity refers to the quantity of the first item in the list.