Dashbot

Amazon Lex Integration

Amazon Lex Integration

Create an API Key

Each chatbot or voice skill, needs its own API Key for tracking.

Add a Chatbot and select Lex as the Platform.

The Key will be used below as the value for DASHBOT_API_KEY in the instructions for sending logs to Dashbot.

Create Cloudformation Stack [Optional]

In the steps below, you create a Cloudwatch Logs log-group, a IAM role with permissions for allowing lex to write to Cloudwatch Logs, and a Lambda function with code we provide to feed conversation logs from Cloudwatch Logs to Dashbot.

For convenience, we have also provided a Cloudformation file in the link below, which provides the same resources but with less flexibility in customization.

Cloudformation Stack

After you create your cloudformation stack, attach the log-group and the role to the lex bot alias as instructed below.

Enable Conversation Logs on Amazon Lex

Step 1: Create a new Log Group in CloudWatch Logs.

For example, with the name “my-bot-text-logs”

Step 2: Create an IAM role and provide write permissions to the Log Group created above.

For example, with the name “MyBotLogRole”

Step 3: Enable Logs in Amazon Lex

  1. In the Lex console, select the chatbot
  2. Choose Settings
  3. Choose Conversation Logs
  4. Choose the Settings gear icon for Prod
  5. Under Log Type, select Text logs
  6. For Log Group name, select the group “my-bot-text-logs” created above
  7. For IAM role, select the role, “MyBotLogRole” created above
  8. Save

Integrate Amazon Lex Conversation Logs into Dashbot

Now that conversations are being logged to Cloudwatch, configure a subscription to send these to Dashbot.

  1. Navigate to AWS Lambda service on the Console.
  2. Choose Create function
  3. Provide a Function name such as lex-dashbot-integration
  4. Choose the latest version of Node.js in the Runtime language
  5. Select Create new role with basic permissions
  6. Click on Create function
  7. In the function code select “Upload a file from Amazon S3” and enter this URL: https://dashbot-us-east-1-public-lex-cloudwatch-import.s3.amazonaws.com/f74c2e8da62424e6107afebb248acc4f
  8. In Environment variables, add DASHBOT_API_KEY with the Dashbot API Key created above
  9. Click on Add trigger and add CloudWatch Logs in the trigger configuration
  10. Select the appropriate Log group from the drop down
    Note: Use the same CloudWatch Log group selected during Conversation logs setup
  11. Choose a Filter name and click Add

Test Integration

To test the integration, send messages to your chatbot.

Open Dashbot reports, and from the Real Time section in the left nav, select Live Transcripts.

The messages should appear in the Live Transcripts.

Edit this page on GitHub

On this page