Example: Using a Response Card
In this exercise,
you extend Getting Started Exercise 1 by adding a response card. You create a bot that
supports the OrderFlowers intent, and then update the intent by adding a response card for
FlowerType slot. In addition to the following prompt for the
FlowerType slot, the user can choose the type of flowers from the response
What type of flowers would you like to order?
The following is the response card:
The bot user can either type the text or choose from the list of flower types. This response card is configured with an image, which appears in the client as shown. For more information about response cards, see Response Cards.
At this time, response cards are supported only for the Facebook Messenger platform. To use this feature, you must deploy your bot on the Facebook Messenger platform. To see the response card, you test the bot on Facebook Messenger.
To create and test a bot with a response card:
Follow Getting Started Exercise 1 to create and test an OrderFlowers bot. You must complete steps 1, 2, and 3. You don't need to add a Lambda function to test the response card. For instructions, see Exercise 1: Create an Amazon Lex Bot Using a Blueprint.
Update the bot by adding the response card, and then publish a version. When you publish a version, specify an alias (BETA) to point to it.
In the Amazon Lex console, choose your bot.
Choose the settings gear icon next to the "What type of flowers" Prompt to configure a response card for the
Configure three buttons as shown in the following screen shot. You can optionally add an image to the response card, provided you have an image URL.
Verify the button values in the Preview, and then choose Save.
On the Editor tab, choose Save to save the intent configuration.
To build the bot, choose Build.
To publish a bot version, choose Publish. Specify BETA as an alias that points to the bot version. For information about versioning, see Versioning and Aliases.
Deploy the bot on the Facebook Messenger platform and test the integration. For instructions, see Integrating an Amazon Lex Bot with Facebook Messenger.
When you order flowers, the message window shows the response card so you can choose a flower type.