Configure Twilio Whatsapp

Please note that Twilio for WhatsApp is currently a Beta product available from Twilio. Please review the details on this Beta product on the Twilio site https://www.twilio.com/docs/sms/whatsapp/api.

The Twilio API for WhatsApp helps organizations send and receive messages to their WhatsApp users.

To configure the WhatsApp chat channel, a Skills Builder Administrator needs to complete the following steps:

  1. Register and create an account in Twilio. Once the account is created, set up billing for the Twilio messages/transactions. For details about the pricing and billing, refer to https://www.twilio.com/whatsapp/pricing/us.

  2. Create a Project in Twilio. Copy the Account SIDAuth Token, Sender number, activation code, and retain them in an easily accessible location such as notepad or any text editor tool.

  3. Configure and Enable the WhatsApp chat channel in Luma Virtual Agent using the Account SID and Auth Token from the Twilio Whatsapp project.

  4. Invite users to use the WhatsApp channel to interact with Virtual Agent.

Step 1: Register in Twilio

To use WhatsApp with Luma Virtual Agent, you need to first register on Twilio. To do so, follow the below steps:

  1. Navigate to the Twilio website by entering the URL www.twilio.com. The Twilio home page appears as shown below.

     

  2. Create an account in Twilio by clicking Sign up. To know how to sign up for a Twilio account and other account management details, refer https://support.twilio.com/hc/en-us/sections/205104908-Account-Management.
    If you already have an account, skip to the next step (point 3).

    1. On sign up screen, add the required details and Password.

    2. Select the 'I accept Twilio Privacy statement….' and click on Start your free trial to create your account.

    3. An email will be triggered to the email address (added in the above step) to verify your account.

    4. Click on the link in the email and confirm your email address.

    5. The link redirects you back to Twilio. To verify your phone number, add your number and click on Verify.

    6. Enter the verification code received on your phone and click on Submit.

    7. The account is now verified. Finish account creation and go to the Project Dashboard.
      On ‘Do you write code’, click No and click on Skip to Dashboard.

  3. If you already have an account, log in to Twilio using your account details and navigate to Dashboard.

     

  4. Once logged in, the next step is to create a new project. If you already have a project, skip to the next step (point 5).

    1. On the Project Dashboard, click on Create New Project.

    2. Add the Project Name and click Verify.

    3. Provide your phone number and verification code to verify your account (as in point 2→e). Now skip to Dashboard.

    4. Your project is now ready.

  5. On the Project Dashboard, copy the below details and retain the information in notepad to be used for channel configuration in Luma. Click on the copy button on the fields:

    1. Account SID

    2. Auth Token

Step 2: Configure Whatsapp in Luma Virtual Agent

  1. The next step is to configure and enable WhatsApp as a chat channel in Luma Virtual Agent.

    1. Log in to your tenant on the Bot Builder UI.

    2. Navigate to Bot Menu → Configurations → Channels. Click on the Twilio WhatsApp tile and open configurations.

    3. Now add the Account SID and Auth Token (copied in Step 2 → point 5) to the respective fields on the configuration screen in Bot builder UI.

    4. On User Reconciliation For Channel Authentication section, specify the user information that should be used for auto authentication and user data reconciliation with Luma Virtual Agent record fields. Since Whatsapp uses the user’s Phone number for authentication, select ‘phone in User Fields and click on Set.

    5. Copy the Message URL and retain the information on a notepad to be used to configure messaging service in Twilio in a later step.

    6. Click on Configure to enable WhatsApp. The channel is now enabled and set to Active.

Step 3: Configure WhatsApp Sandbox

Once the channel is configured in Bot Builder UI, the next step is to create and set up your Sandbox. The Twilio Sandbox for WhatsApp helps you to connect to your Bot.

  1. On Twilio, navigate to the Project Dashboard. Click on All Products & Services.

  2. Go to Programmable Messaging.

     

  3. Click on Settings → WhatsApp Sandbox Settings.

     

  4. A confirmation message appears to activate your Sandbox. Agree to the Terms of Service and click on Confirm.

     

  5. The Twilio Sandbox for WhatsApp page appears.

    1. On the Sandbox Configuration section, set up the endpoint URL. This indicates the Luma environment and tenant the Sandbox should connect to.

    2. Copy the Message URL copied/retained in Step 2 → point 1(e) and paste the URL in ‘When a Message Comes in' field and click Save.

    3. The Sandbox is now ready.

       

Step 4: Invite Users to your Sandbox

Now the channel is active and Sandbox is configured, you can invite users from your organization to connect to Luma Virtual Agent through WhatsApp. In order to use your Whatsapp Sandbox, the End-user should do the following:

  1. Add the Sender number given in the Sandbox Participants section of their contact list.

  2. Once the number is added, send a WhatsApp message to the number with Activation code.

The user will be added to the Sandbox. All users (phone numbers) with access to the bot, are available under USERID.

  1. The users can now start interacting with Luma Virtual Agent through WhatsApp. If the logged-in user is already available in Luma Virtual Agent , (with the phone number used for WhatsApp), the user will be auto-authenticated by the system. No manual registration is required.

     

  2. In case, the user is not available in Luma Virtual Agent, the system recognizes such users as Anonymous Users and prompts the user to register in Luma Virtual Agent .

     

Points to Remember:

  1. User’s Phone number in Luma Virtual Agent should be in the same format <Country code><phone number> as used to install and configure WhatsApp. If the number is not incorrect, the user will not be auto authenticated in Luma Virtual Agent .

  2. Whatsapp is a text-based channel and does not support cards and quick replies. Bot Responses set as Cards or Quick replies appear as choices with numbers, that are used to select the required option.

Twilio Pricing

Once your Twilio account is created, ensure that you set up billing for the Twilio messages/transactions. There are two types of messages -

  • WhatsApp Session message

  • WhatsApp template message.

WhatsApp Session message is any message sent or received in response to a user-initiated session. A messaging session starts when a user sends a message to Luma Virtual Agent and lasts for 24 hours from the most recently received message. You can wait for users to message, or you can send a Template Message to invite the user to respond.

WhatsApp template message is Luma Virtual Agent initiated (follow up, approval, or resolution). They are pre-approved message templates for outbound notifications such as delivery alerts and appointment reminders. A WhatsApp Template Message can be used if more than 24 hours have elapsed since the user last responded to you. Any other type of message will fail. 

For more details on how much Twilio charges for the different types of messages, refer https://www.twilio.com/whatsapp/pricing/us.

© 2019 Serviceaide 1-650-206-8988 http://www.serviceaide.com info@serviceaide.com