is through many different chat channels but for some organizations WhatsApp is the way their users communicate with each other and with the support team. The Twilio API for WhatsApp helps organizations send and receive messages to WhatsApp users using the Twilio Messaging API.
To configure the WhatsApp chat channel, a Skills Builder Administrator needs to complete the following high-level steps:
- Register in Twilio by creating an account. Once the account is created, set up billing for the Twilio messages/transactions. For details about the pricing and billing, refer https://www.twilio.com/whatsapp/pricing/us.
- From Twilio, copy the Account SID, Auth Token, and finally the Sender number and retain them in an easily accessible location such as notepad or a text editor tool.
- Configure the WhatsApp chat channel in Luma using the Account SID, Auth Token and Sender number from the Skills Builder.
- Enable the WhatsApp channel in the Skills Builder.
Register in Twilio
To use WhatsApp with Luma, you need to first register on Twilio. To do so:
- to the Twilio website by entering the URL www.twilio.com.
The Twilio home page appears as shown below.
Create an account in Twilio by clicking Signup.
, on the Create a Project page (which appears after submitting the verification code), on the Templates tab, select the SMS Chatbot tile.
The Twilio home page appears, and your are prompted to login.
- Enter the Login ID and click Next as shown below.
- Enter the Password to login.
- Confirm that you are not a robot by selecting the check box.
- Click Login.
The Custom Project page appears as shown below.
- Enter a new Project Name and click Continue.
- If you want to add anyone to this project for the purpose of development and to track the progress, then you can invite them to Twilio by clicking Invite a Teammate. Else, click Skip this Step to proceed to the next page.
The Project Dashboard page appears as shown .
- Copy the Account SID and Auth Token and keep it at an easily retrievable location such as notepad or a text editor tool.
- Click the Programmable SMS link to integrate with Whatsapp.
The Programmable SMS Dashboard page appears as shown below.
- On the Programmable SMS Dashboard page, click WhatsApp Beta from the left menu.
The Activate your Sandbox dialog box appears as shown below. The Twilio Sandbox for WhatsApp helps you to access a shared WhatsApp phone number, pre-approved for Twilio developers.
- To setup your Sandbox, go through WhatsApp's Terms of Service by clicking the link and select the check box to agree and see your Sandbox.
- Click Confirm.
The Twilio Sandbox for WhatsApp page appears as shown .
- In the Sandbox Configuration section, include the Message URL from Luma in the When a Message Comes in field. The URL entered in this field is used by Luma to receive message from Twilio.
- In the Sandbox Participants section, copy the WhatsApp number and joining code and save it at an easily retrievable location such as notepad or a text editor tool.
- Click Save.
Once your Twilio account is created, ensure that you set up billing for the Twilio messages/transactions. There are two types of messages - session message and WhatsApp template message. A WhatsApp Session message is any message sent or received in response to a user-initiated session. A messaging session starts when a user send a message to Luma, 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.
A WhatsApp template message is Luma 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.
Enable WhatsApp Channel in Skills Builder
To enable WhatsApp in Skills Builder, do the following:
- On the Bots dashboard, from more options click Bot Configuration as shown below.
- On the Bot Configuration page, click the Channels tab.
The Channels page appears as shown below.
- Select WhatsApp from the Configure Channel list.
The Configure WhatsApp dialog box appears as shown below.
Paste the copied Account SID, Auth Token (from step 10 in Register in Twilio section) and Sender Number (from step 16 in Register in Twilio section) from Twilio in the Configure WhatsApp dialog box.
Copy the Message URL and paste it in the Twilio > Programable SMS > WhatsApp (Beta) Sandbox > When a Message Comes in (step 16 in Register in Twilio section). You can use the copy icon to the right to simplify the operation.
- Click Save to enable the WhatsApp channel. The WhatsApp channel is now enabled.
- The configured WhatsApp is shown on the Channels page.
- If required, use the toggle button () to make the channel inactive. You can inactivate the WhatsApp if you do not want to use it.
- If required, use the edit button () to edit the WhatsApp details.
Chat with Luma
the Twilio sign up is completed and WhatsApp is enabled in the Skills Builder, to chat with Luma, do the following:
- On your phone, add the WhatsApp contact (with the number saved in step 16 in Register in Twilio section).
- Once the contact is added, enter the joining code as shown .
- After registration, you can execute the skills.