AWS Contact Center

Building personalized customer experiences over SMS through Amazon Connect

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:

Walkthrough

Setup Amazon Pinpoint

  1. Navigate to the Amazon Pinpoint console
  2. Provide a project name, Click Create a Project
  3. Click Configure for SMS and voice.
  4. Check Enable the SMS channel for this project
  5. Choose Transactional as the default message type.
  6. 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.
  7. Click Advanced configurations
  8. Choose Request phone number
  9. Choose the Country from the drop down and select the appropriate phone Number type such as Tollfree
  10. Under capabilities check SMS
  11. Choose Transactional as the default message type.
  12. Click Next, and Request
  13. 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

  1. Navigate to AWS Amazon Connect console
  2. Choose the Amazon Connect instance and note down the Instance ARN
  3. 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
  1. Using Git, clone the repository from Github
    git clone git@github.com:amazon-connect/amazon-connect-message-streaming-examples.git
  2. In your terminal move into the root of the directory
    cd amazon-connect-message-streaming-examples
  3. 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 ../../..
  4. 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>
  5. Once the CDK deployment has finished note down the SmsInboundTopic from the CDK output.

Enable two-way SMS in Amazon Pinpoint

  1. Navigate to the Amazon Pinpoint console, SMS and Voice, Phone numbers
  2. Choose your phone number
  3. 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
  4. 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

  1. Navigate to Amazon Pinpoint console, Settings, General settings and Delete project
  2. Navigate to SMS and Voice, Phone numbers, select your phone number and Remove phone number
  3. 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!