

# Integrating an Amazon Lex V2 bot with Twilio SMS
Integrating with Twilio SMS

This topic provides instructions for integrating an Amazon Lex V2 bot with the Twilio simple message service (SMS). You perform the following steps:

**Topics**
+ [

# Step 1: Create a Twilio SMS account
](twilio-step-1.md)
+ [

# Step 2: Integrate the Twilio message service endpoint with the Amazon Lex V2 bot
](twilio-step-2.md)
+ [

# Step 3: Complete Twilio integration between your Lex V2 bot and Twilio
](twilio-step-3.md)
+ [

# Step 4: Test the integration between your Lex V2 bot and Twilio
](twilio-step-4.md)

# Step 1: Create a Twilio SMS account


Sign up for a Twilio account and record the following account information: 
+ **ACCOUNT SID**
+ **AUTH TOKEN**

For sign-up instructions, see [ https://www.twilio.com/console ](https://www.twilio.com/console).

## Next step


[Step 2: Integrate the Twilio message service endpoint with the Amazon Lex V2 bot](twilio-step-2.md)

# Step 2: Integrate the Twilio message service endpoint with the Amazon Lex V2 bot


1. Sign in to the AWS Management Console and open the Amazon Lex console at [https://console.aws.amazon.com/lex/](https://console.aws.amazon.com/lex/).

1. From the list of bots, choose the Amazon Lex V2 bot that you created.

1. In the left menu, choose **Channel integrations** and then choose **Add channel**.

1. In **Create channel**, do the following:

   1. For **Platform**, choose **Twilio**.

   1. For **Identity policies**, choose the AWS KMS key to protect channel information. The default key is provided by Amazon Lex V2.

   1. For **Integration configuration**, give the channel a name and an optional description. Choose the alias that points to the version of the bot to use, and choose the language that the channel supports.

   1. For **Additional configuration**, enter the account SID and authentication token from the Twilio dashboard.

1. Choose **Create**.

1. From the list of channels, choose the channel that you just created.

1. Copy the **Callback URL**.

## Next step


[Step 3: Complete Twilio integration between your Lex V2 bot and Twilio](twilio-step-3.md)

# Step 3: Complete Twilio integration between your Lex V2 bot and Twilio


Use the Twilio console to complete the integration of your Amazon Lex V2 bot with Twilio SMS.

1. Open the Twilio console at [ https://www.twilio.com/console ](https://www.twilio.com/console).

1. From the left menu, choose **All Products & Services**, then choose **Phone Number**.

1. If you have a phone number, choose it. If you don't have a phone number, choose **Buy a Number** to get one.

1. In the **Messaging** section, in **A MESSAGE COMES IN**, enter the callback URL from the Amazon Lex V2 console.

1. Choose **Save**.

## Next step


[Step 4: Test the integration between your Lex V2 bot and Twilio](twilio-step-4.md)

# Step 4: Test the integration between your Lex V2 bot and Twilio


Use your mobile phone to test the integration between Twilio SMS and your bot. Using your mobile phone, send messages to the Twilio number.

If you created the bot using [Exercise 1: Create a chatbot from a template](exercise-1.md), you can use the example conversations from that exercise.