Create Collaborative Conversations Across Applications and SMS Using the Amazon Chime SDK and Amazon Pinpoint

Chanci Turner Amazon IXD – VGT2 learning managerLearn About Amazon VGT2 Learning Manager Chanci Turner

In sales and customer service, chat messaging serves as a powerful communication tool that allows customers and employees to interact seamlessly, similar to how they engage with friends and family. These asynchronous dialogues not only advance the sales or service process but also foster relationships between employees and customers. Typical scenarios involve employees not directly associated with the contact center and often necessitate the involvement of multiple parties. For instance, interactions may occur between delivery drivers and customers, vacation home owners and guests, real estate agents and clients, financial advisors and clients, maintenance personnel and customers, among others. How a participant accesses a conversation is contingent on their role and specific context; for example, a traveling employee might rely on a mobile app, while an office worker may prefer a web application, and a customer might opt for SMS to avoid downloading an app.

Facilitating communication across various devices and platforms, commonly referred to as omni-channel or cross-channel chat, can be challenging without the appropriate tools. The Amazon Chime SDK allows you to build scalable chat solutions capable of supporting thousands of users in a single conversation. It also offers administrative features such as identity integration, archival and retention, and straightforward integration with other services for message processing. This processing can be utilized to update messages, translate them, or eliminate potentially sensitive information, such as profanity and Personally Identifiable Information (PII). Moreover, message processing can facilitate sending and receiving messages via SMS or popular over-the-top (OTT) applications like WhatsApp and Facebook Messenger. The Amazon Chime SDK empowers you with control over how and where messaging data is processed, ensuring data remains within AWS’s security framework.

This blog post will guide you through utilizing the Amazon Chime SDK and Amazon Pinpoint to streamline the home loan process, enabling various parties to collaborate through chat using a web application and SMS. After completing the steps below, you’ll have a functioning web application that mirrors the experience of employees on the lending side working with multiple clients. Additionally, you will have a phone number that home buyers can utilize to communicate with the lending team throughout the buying journey. The demo concept kicks off once a home buyer has received pre-approval for a loan and a loan team is assigned to assist them during the process.

Overview

The example application discussed in this post revolves around the Amazon Chime SDK and the channel flows feature. Channel flows allow developers to implement business logic on messages as they are transmitted, prior to delivery to members of a messaging channel. By employing channel flows, you can create processes that remove sensitive data, such as government ID numbers, phone numbers, or inappropriate language, from messages before they reach their destination—beneficial for enforcing corporate communication policies or other guidelines. In this instance, channel flows are leveraged to facilitate SMS messaging via Amazon Pinpoint.

Referencing the diagram below:

  1. The home buyer sends a message via SMS, which is received by Amazon Pinpoint.
  2. Amazon Pinpoint forwards the message to Amazon Simple Notification Service (SNS) and subsequently to AWS Lambda.
  3. AWS Lambda interacts with Amazon Lex to provide a conversational interface for user verification and to add additional SMS participants.
  4. During the verification process, AWS Lambda checks loan numbers against a table in Amazon DynamoDB, which also stores channels and loan IDs linked to phone numbers.
  5. Incoming SMS messages are directed to Amazon Chime SDK messaging channels using a lookup table that matches the sender’s phone number to the relevant channel.
  6. New messages from either SMS or web app users are processed through the channel flow, invoking AWS Lambda. In this demonstration, the flow results in outbound SMS messages to recipients participating via SMS and blocks any messages containing inappropriate language.

Deploying the Demo

Follow the steps below to configure Amazon Pinpoint, Amazon Lex, and utilize AWS CloudFormation to establish the Amazon Chime SDK and other backend services for deploying the example application. Be mindful that your AWS account will incur charges for using these services.

Amazon Pinpoint

  1. Open the Amazon Pinpoint console.
  2. Select “Create a project.”
  3. Enter a project name and choose “Create.”
  4. Click “Configure” under SMS and Voice:
    • Enable the SMS channel for this project under General Settings.
    • Change the default message type to TRANSACTIONAL.
    • Save changes while keeping other settings as they are.
  5. Navigate to Settings on the left, then SMS and Voice.
  6. Choose “Request Phone number” under Phone numbers → Number settings:
    • Select “United States” as the Country (other countries are viable as long as configured for 2-way SMS).
    • Choose “Toll-Free” as the number type.
    • Enable SMS capability.
    • Set the default message type to TRANSACTIONAL, select a quantity of 1, then click “Request.”
  7. Locate and select your new phone number under Number settings:
    • At the bottom of the form, enable 2-way SMS.
    • For Incoming message destination, create a new SNS topic and name it “AmazonChimeSDKSMSBlogSetup” or your choice.
    • Save and note the Amazon SNS topic ARN by returning to the phone number detail and expanding the Two-way SMS section.
  8. Add at least one destination phone number; we suggest adding two to experience multi-channel interactions.
    • Add Phone Number and enter the verification code received.
  9. Return to the Amazon Pinpoint main console and note the project ID.

Amazon Lex

  1. Access the Amazon Lex V2 console; the import won’t function in Amazon Lex V1. Navigate to Actions → Import.
  2. Name the bot “SMSBlogBot” or any other name of your preference.
  3. Upload the “AmazonChimeSDKSMSBlogLex.zip” file.
  4. Create a role with basic Amazon Lex permissions, select “No” for COPPA, set the timeout to 10 minutes, and choose “Import.”
  5. Select the newly created bot and note the Bot ID in the Bot details section.
  6. Choose “View Alias” → “TestBotAlias” and note the Bot Alias ID.
  7. Go to Bot versions → Draft version → English, and select “Build.”

AWS CloudFormation

Click on the “Launch Stack” image below to initiate a CloudFormation template that will establish the necessary infrastructure for the Amazon Chime SDK chat demo app in your AWS account. Fill in the following information:

  • Stack Name: The default is AmazonChimeSDKSMSBlogSetup.
  • ChimeAppInstanceUserPrefix: The default is loanConsultant; users with this prefix will be identified as part of the loan team and added to new channels.
  • DemoName: The default is AWSSDKChimeChannelFlowSMSDemo.
  • LexBotAliasId: Enter the bot alias ID you noted earlier.
  • LexBotId: Enter the Lex bot ID you noted earlier.
  • PinpointOriginationNumber: Input the toll-free number requested, formatted as +185585xxxxx.

For more insights on navigating financial challenges, check out this helpful blog post by Chanci Turner here. Additionally, to understand the evolving technologies that support remote workers, visit SHRM. For excellent resources on onboarding, take a look at this link.

HOME