Skip to content

Advanced Request Response (Alexa) v3.0.3 Help

Delivers a message defined via JSON, then waits for Alexa to recognize the intent in the end user's response.

Note: Steps of the Alexa toolkit work only with existing custom Alexa skills with the method to host your skill's backend resources selected as Provision your own. The skill interaction model must be built with intents and slots on the Amazon developer colsole prior to building solutions with the Alexa toolkit.

How can I use the Step?

You can use this Step to take the Flow down a specific exit depending on the intent in the end user's response. The message delivered to the end user is formed using JSON and may include additional Alexa features (i.e., directives).

Note To request a slot value for a specific intent, use the Request Response (Alexa) Step.

How does the Step work?

First, you select an authorization and a skill. Then, you define which intents to handle. After that, you define the message content.

When Alexa delivers the defined message to the end user and receives their response, the following happens:

  • If Alexa recognizes the intent in the end user's response and it matches one of the specified intents in the Step, the Flow proceeds down the respective exit.
  • If the recognized intent does not match a specified intent, the Flow proceeds down the other exit.

This Step also allows handling situations when Alexa or the end user ends the current session.

Prerequisites

Before building Flows using the Alexa toolkit, you must complete the following steps:

  1. Create a Custom Alexa skill with at least one intent in the Amazon developers console. Read more on how to create Alexa skills here.
  2. Install the Alexa Skill Adapter flow. See the instruction here.
  3. Create an authorization of your OneReach.ai account with the Amazon developer account. See the instructions in the Add an authorization modal of the Authorization section of an Alexa Step.

Alexa Skill Adapter Flow

The Alexa Skill Adapter Flow is required to manage the interactions between OneReach.ai and the Amazon developer console. To install it take the following steps:

  1. Add any gateway Step template from the Alexa toolkit to the Flow. For example, a Wait for Intent (Alexa) Step.
  2. Go to the Details tab of the added Step. The Authorization collapsible group contains a warning message with the Install Adapter button. Click to install the adapter Flow. After the installation is completed, a respective message should appear.

Note: In case Alexa Skill Adapter Flow is deactivated or deleted, a respective alert will pop up in the gateway Step of the Flow with a button to fix the problem.

Authorization

To set up an authorization, select one of the two options:

  • Click the Select authorization in current step option to select an authorization from the respective dropdown in this Step. Use this option when you need to:
  • Select the Inherit from previous step option to choose the authorization that was used in the last executed Step of the Alexa toolkit in the Flow. Use this option when you have already created an authorization and used it previously in the Flow.

Create a new authorization

To create a new authorization, do the following:

  1. Click the Select authorization in current step button.
  2. Click the Gear button, then Add, or select to Create new authorization in the dropdown.
  3. A modal window for creating a new authorization will pop up. Follow the instructions in the modal's collapsible. When finished, the created Authorization name should be added to the list in the dropdown. Click Gear > Refresh to update the list of authorizations.
  4. Select respective Authorization name in the Select authorization in current step dropdown.

Select authorization in current step

The Select authorization in current step dropdown lists every authorization added to your OneReach.ai account.

  • To choose an authorization, select its name in the dropdown.

The Gear button contains options to Add a new or Delete an existing authorization, as well as to Refresh the list of added authorizations.

In case some changes were made to the authorization, an option to Reauthorize is available. To do that, click the respective button, then:

  1. Click Reauthorize now in the modal window. A new Amazon tab will open.
  2. Enter the login and password of the Alexa developer account.
  3. Click Allow.

Inherit from previous step

When a Step from the Alexa toolkit is added to the Flow, you are expected to manually choose an authorization from the respective dropdown. If another Step from the toolkit is added to the Flow, the option to Inherit from previous step is chosen by default. When selected, it continues to use the same authorization as was defined in the previous Step of the toolkit without the need to select it manually.

Warning! If the Inherit from previous step option is selected, but there is no Step of the same toolkit in the Flow, the Step results in an error.

Alexa skill

If the authorization was successful, the Alexa skill dropdown should contain the list of available custom skills created in the connected Amazon developer console.

To choose a skill, select one of the two options:

Click the Refresh button to update the list of available skills. Click the Refresh skill interaction model to get the latest version of the selected skill.

Select skill in current step

After a skill has been selected, the Step checks the following settings:

Endpoint URL

Endpoint URL should be updated automatically by the Step. In case it fails, a link to copy the Endpoint URL becomes available. To set it manually do the following:

  1. Open the Alexa developer console.
  2. Select the respective skill.
  3. Select Build > Endpoint, then select the HTTPS option as the Service Endpoint Type.
  4. Paste the Endpoint URL value in the respective field of the required region.
  5. Set the respective SSL certificate type as My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority.
  6. Click Save.
  7. Go to Build, then click Build Skill.
  8. Return to the Flow after the skill has been updated and click Refresh skill interaction model.

Auto Delegation

Auto Delegation should be turned off automatically by the Step. In case it fails, a respective alert should pop up on Step UI. To turn it off manually do the following:

  1. Open the Alexa developer console.
  2. Select the respective skill.
  3. Select Build > Interfaces.
  4. Turn off the Auto Delegation toggle.
  5. Click Save.
  6. Go to Build, then click Build Skill.
  7. Return to the Flow after the skill has been updated and click Refresh skill interaction model.

Use same skill as previous step

When a Step from the Alexa toolkit is added to the Flow, and an authorization is selected, you are expected to manually choose a skill from the respective dropdown. If another Step from the toolkit is added to the Flow, the option to Use same skill as previous step is chosen by default. When selected, it continues to use the same skill as was defined in the previous Step of the toolkit without the need to select it manually.

Warning! If the Use same skill as previous step option is selected, but there is no Step of the same toolkit in the Flow, the Step results in an error.

Request settings

In this section you define the intents that the Step handles. By default, if no intents were added in the Step but Alexa understands an intent in the end user's response, the Flow proceeds down the other exit. To take the Flow down a specific exit that matches the recognized intent, do the following:

  1. Click the Add intent button.
  2. Provide the Intent name.
  3. Define the Exit name.
  4. To add multiple intents, repeat steps 1-3.

Intent name

The intent name value is expected to exactly match an existing intent in the selected skill. The respective dropdown should contain all created intents in the selected skill. To provide the intent name manually or via a merge field, enter its value, then click +.

Exit name

Each intent defined via the Add intent button adds a new exit to the Step. The Exit name is the label shown above the respective exit. It should not match existing exit names, such as next, other, session-end or error. Provide its value manually or via a Merge field.

Note: If you select the Intent name in the dropdown, the Step populates the Exit name automatically.

Message content

In this section you define the message that Alexa delivers to the end user in the Response JSON input.

Note: It is advisable to test the message in the Alexa development console to make sure it is reproduced correctly.

The Response JSON input is expected as JSON object and must contain an outbound message. You can also include a reprompt message and a card, as well as use directives. Learn more about response format and syntax here. A general structure of the response object is added to the field by default.

Warning! The shouldEndSession property is preset as false and should not be used in this input.

Other events handling

In this section you can define the Step behavior when the expected response was not received from the end user.

Handle session ended event

By default, if Alexa sends the sessionEndedRequest to the Step, the Flow proceeds down the session-end exit. This may occur in the following cases:

  • The end user says exit or quit.
  • The end user does not respond.
  • The end user says something that does not match an intent defined in your voice interface while the device is listening for their response.
  • An error occurs.

Note: You can use the session-end exit for reporting, data collection, etc., but cannot use it to continue communication between Alexa and the end user.

When the Handle session ended event toggle is turned off, the session-end exit is removed from the Step. If Alexa sends the sessionEndedRequest, the Flow fails immeadiately after exceeding the Flow timeout.

Note: You can process sessionEndedRequest in another Flow using the Wait for Session Ended Request (Alexa) Step.

Output data

This section is optional and allows setting up the properties of the input object that become available as the quick access Merge field values further in the Flow.

The Step outputs the full input JSON object sent by Alexa in its request property. The intent name and slot data are duplicated in the top-level as intentName and slots properties respectively.

To set up this section, do the following:

Slots

When you select an intent in the dropdown, all slots defined in the respective intent are added to the Step UI automatically. Each slot is defined by its name, which must exactly match the respective Slot name in the intent for Alexa to recognize and populate.

To add a slot manually, click the Add slot button, then, provide the Slot name in the respective field.

Each defined slot becomes available as a Merge field value later in the Flow. To remove a slot, click the Bucket icon.

Note: If Alexa matches the end user's word or phrase with a slot, it populates the respective slot, and the Step adds it to the output. The slots defined in this section only provide quick access via Merge field values further in the Flow.

Additional properties

By default, the Step includes only the request property in its output. To include additional properties, select them in this section.

Merge field settings

The output data of the Step is stored in a JSON object under the name provided in the Merge field name. To learn more about Merge fields, their types, and how to work with them, follow this link.

Output example

You can select which properties to include in the Output data section.

See below the structure of the Merge field object:

json
{
  "request": {
    "type": "IntentRequest",
    "requestId": "string",
    "timestamp": "2018-04-27T21:36:34Z",
    "locale": "en-US",
    "intent": {
      "name": "string",
      "confirmationStatus": "string",
      "slots": {}
    }
  }
}
{
  "request": {
    "type": "IntentRequest",
    "requestId": "string",
    "timestamp": "2018-04-27T21:36:34Z",
    "locale": "en-US",
    "intent": {
      "name": "string",
      "confirmationStatus": "string",
      "slots": {}
    }
  }
}

Error handling

By default, the Step handles errors using a separate exit. If an error occurs during the Step execution, the Flow proceeds down the error exit, e.g. if the selected intent isn't found. For more information on error handling, follow this link.

Reporting

The Step automatically generates Reporting events during its execution, allowing for real-time tracking and analysis of its performance and user interactions. To learn more about Reporting events, follow this link.

Services dependencies

  • Alexa Skill Adapter v3.0.0 or upper

Release notes