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.

Enable Conversation Logs on Amazon Lex

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

For example “my-bot-text-logs”

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

For example, “MyBotLogRole”

Step 3: Enable Logs in Amazon Lex

  • In the Lex console, select the chatbot
  • Choose Settings
  • Choose Conversation Logs
  • Choose the Settings gear icon for Prod
  • Under Log Type, select Text logs
  • For Log Group name, select the group “my-bot-text-logs” created above
  • For IAM role, select the role, “MyBotLogRole” created above
  • Save

Integrate Amazon Lex Conversation Logs into Dashbot

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

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

Close Menu