AWS Contact Center
Building personalized customer experiences over SMS through Amazon Connect
Join us for AWS Contact Center Day, a free virtual event where you’ll learn about the future of customer service, how machine learning can optimize customer and agent experiences—and more. Register now »
Thousands of companies use Amazon Connect to solve millions of customer issues daily via calls and chats. Many of these companies also want to provide support for their customers through SMS (short message service, i.e. text messaging), as nearly all consumers own a mobile device and typically read text messages within 90 seconds. For consumers that prefer texting, they like that SMS provides them with the flexibility to get support while on-the-go, instead of waiting on hold or remaining connected to a web chat session.
Now, using Amazon Connect Chat’s new message streaming APIs, you can now provide familiar and convenient support to your customers via SMS. In this blog post, you will learn how to build an SMS channel for Amazon Connect using the Amazon Connect Chat message streaming APIs and Amazon Pinpoint’s two-way SMS functionality. Once you set up two-way SMS following the steps in this post, inbound text messages will be routed through your Amazon Connect instance. Your agents can then receive and reply to those text messages in real-time from the same agent desktop they already use for Amazon Connect voice and chat.
Overview
In this blog we will deploy an example project from our Github repository which setups an example end to end infrastructure to support two-way SMS。
To learn how to use these APIs to integrate Amazon Connect Chat with Facebook Messenger and other digital channels, check out our other blog.
Prerequisites
For this walkthrough, you should have the following prerequisites:
- An AWS account with administrator access
- An Amazon Connect Instance
- An Amazon Connect Contact Flow setup for Amazon Connect (include Disconnect flow)
- AWS CLI setup in your local environment
Walkthrough
Setup Amazon Pinpoint
- Navigate to the Amazon Pinpoint console
- Provide a project name, Click Create a Project
- Click Configure for SMS and voice.
- Check Enable the SMS channel for this project
- Choose Transactional as the default message type.
- Set the Account spending limit, by default new AWS accounts have a $1 USD spending limit, please open a support case with AWS Support to have this limit increased.
- Click Advanced configurations
- Choose Request phone number
- Choose the Country from the drop down and select the appropriate phone Number type such as Tollfree
- Under capabilities check SMS
- Choose Transactional as the default message type.
- Click Next, and Request
- Note down both the Pinpoint App ID and the phone number you claimed make sure it is in e164 format.
Get Amazon Connect instance details
- Navigate to AWS Amazon Connect console
- Choose the Amazon Connect instance and note down the Instance ARN
- Login to your Amazon Connect Admin console, contact flows, and choose the contact flow you would like the SMS channel to start the chat contact in and note down the Contact Flow ID
Install AWS CDK and Bootstrap CDK environment (skip if you have CDK installed)
npm -g install typescript
npm -g install aws-cdk
cdk bootstrap aws://ACCOUNT_ID/AWS_REGION
Deploy the project
Make sure you have the following variables from the previous steps before continuing
- Amazon Connect Instance ARN
- Amazon Connect Contact flow ID
- Amazon Pinpoint Application ID
- A two-way SMS enabled phone number from Amazon Pinpoint
- Using Git, clone the repository from Github
git clone git@github.com:amazon-connect/amazon-connect-message-streaming-examples.git
- In your terminal move into the root of the directory
cd amazon-connect-message-streaming-examples
- Install the dependencies for the CDK project and AWS Lambda functions
npm install
cd src/lambda/inboundMessageHandler
npm install
cd ../../..
cd src/lambda/outboundMessageHandler
npm install
cd ../../..
cd src/lambda/digitalChannelHealthCheck
npm install
cd ../../..
- Deploy the CDK project using your AWS CLI profile (if you use default profile, don’t need to specify the profile flag). Pass in the context required for the cdk stack.Note: SMS and Facebook channels are part of the same CDK project. If you are would like to deploy the Facebook channel you need to supply the fbSecretArn context variable, for more details please refer the Facebook blog.
cdk deploy \
--context amazonConnectArn=<YOUR AMAZON CONNECT INSTANCE ARN> \
--context contactFlowId=<YOUR CONTACT FLOW ID> \
--context smsNumber=<YOUR SMS number> \
--context pinpointAppId=<YOUR PINPOINT APP ID>
- Once the CDK deployment has finished note down the SmsInboundTopic from the CDK output.
Enable two-way SMS in Amazon Pinpoint
- Navigate to the Amazon Pinpoint console, SMS and Voice, Phone numbers
- Choose your phone number
- Under Two-way SMS, check enable and choose an existing SNS topic, Choose the Inbound SNS topic deployed by the CDK project in the previous step
- Click Save
Congrats! You’ve successfully added two-way SMS to your Amazon Connect instance. Send a test message from your mobile phone to your pinpoint phone number and you’ll receive it on your agent desktop.
Clean up
- Navigate to Amazon Pinpoint console, Settings, General settings and Delete project
- Navigate to SMS and Voice, Phone numbers, select your phone number and Remove phone number
- Destroy the CDK stack
cdk destroy \
--context amazonConnectArn=<YOUR AMAZON CONNECT INSTANCE ARN> \
--context contactFlowId=<YOUR CONTACT FLOW ID> \
--context smsNumber=<YOUR SMS number> \
--context pinpointAppId=<YOUR PINPOINT APP ID>
Conclusion
In this post, we showed you how to build an SMS channel for Amazon Connect using the Amazon Connect Chat message streaming APIs and Amazon Pinpoint’s two-way SMS functionality. To get started, visit our Github repository and deploy the project!