# Twillio WhatsApp

{% hint style="info" %}
To connect Twilio WhatsApp, a Twilio WhatsApp API account is required. Read our [guide](https://www.twilio.com/whatsapp) to create a Twilio WhatsApp API account.
{% endhint %}

![Twillio for WhatsApp](https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mbui1HRO4dGghy5ITOz%2F-Mcs-uPBWSKhFTW0-1Ln%2F-Mcs0HP9TqAoitRjbf4T%2Fimage.png?alt=media\&token=ef0eec67-02df-4148-bf9c-a1de7460de2a)

In addition to providing SMS services, Twilio is also an API provider that works directly with WhatsApp as an official partner. Twilio also provides other services such as phone number purchases and WhatsApp Official API account management.&#x20;

By integrating Twilio WhatsApp API, the platform can enable you to respond to WhatsApp messages directly.&#x20;

{% hint style="warning" %}
This channel has a limited 24-hour messaging window due to WhatsApp regulations. \
Find out more [here](https://docs.is-messenger.com/ismessenger/messaging-channels/whatsapp/..#messaging-window)!
{% endhint %}

## Connecting Twilio WhatsApp

**Step 1: Navigate to Channel Settings**\
From **Settings** Module, navigate to the menu item, **Channels**

**Step 2: Add Channel**\
Press **Add Channel** and choose **WhatsApp.** Select **Twilio** on the second step

![](https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mbui1HRO4dGghy5ITOz%2Fuploads%2F1DDxkargjYuWIYIXFtdm%2FScreenshot%202022-06-20%20125918.png?alt=media\&token=f340c355-11b5-4904-9b38-8a47d0bfb014)

![](https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mbui1HRO4dGghy5ITOz%2Fuploads%2FAjutTrr0wR9QAQSgy4eP%2FScreenshot%202022-06-20%20134555.png?alt=media\&token=8911bfb0-5fda-46f5-b6ba-c45fa38e76a3)

**Step 3: Sign in to** [**Twilio**](https://www.twilio.com/login)\
Sign in with your user credentials at Twilio

**Step 4: Locate the Account SID and Auth Token**\
Locate both Account SID and Auth Token on the dashboard and add it to the corresponding fields at ISMessenger platform

![](https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mbui1HRO4dGghy5ITOz%2F-Mcs-uPBWSKhFTW0-1Ln%2F-Mcs9Ie_ptpSKo1Ab763%2Fimage.png?alt=media\&token=560afc15-b502-47b3-965a-933186dccf59)

![](https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mbui1HRO4dGghy5ITOz%2Fuploads%2FemSlNVfXcs19b12SR4HK%2FScreenshot%202023-07-27%20161653.png?alt=media\&token=9282c9fa-28f2-4bcf-8aef-1cc9a2283770)

**Step 5: Follow through the instructions**\
After you have filled in the **Account SID** and **Auth Token**, follow through the instructions by pressing **NEXT**.

**Step 6: Configure the WhatsApp Number at Twilio**\
At Twilio platform, navigate to **Programmable Messaging > Senders >** [**WhatsApp Senders**](https://www.twilio.com/console/sms/whatsapp/senders). Press **Edit Sender** next to the WhatsApp Number to be connected.

![](https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mbui1HRO4dGghy5ITOz%2Fuploads%2FjeZpuPPr6fKS4vqlEeGg%2Fimage%20\(4\).png?alt=media\&token=ee3b25be-7a4a-4f2f-89b1-80e0ace0bd9c)

**Step 7: Add the WhatsApp Enabled Number**\
Add the WhatsApp Enabled Number to the corresponding field at IS-Messenger platform. \
E.g.`whatsapp:+620818067812`

**Step 8: Add the generated URLs to configure the WhatsApp Number**\
Copy the generated URLs from IS-Messenger and add them to the corresponding fields at Twilio.

**Step 9: Complete the setup at IS-Messenger**\
Press **DONE** to complete the setup

{% hint style="success" %}
Once you completed the setup, any messages sent to your Twilio WhatsApp Number will now be received in your Space.
{% endhint %}

## Channel Configuration

{% hint style="info" %}
Twilio WhatsApp channel can be configured with a unique channel name.
{% endhint %}

**Step 1:** Navigate to **Workspace Settings** > Click **Channels**.

**Step 2:** Locate the Twilio WhatsApp Channel > Click **Manage > Configuration.**

![](https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mbui1HRO4dGghy5ITOz%2Fuploads%2Fxl7djPHOUuCFFzSaiEOl%2Fimage.png?alt=media\&token=a908e7df-40b3-4aac-9d1e-6f3851abd417)

**Step 3:** Configure the Channel name, which is used internally to identify the account.

{% hint style="warning" %}
**Important**: Ensure all your details are entered correctly as errors may cause outbound messages from your Twilio WhatsApp account to fail.
{% endhint %}

**Step 4:** Click **Save Changes** to update the Channel configuration.

### Metadata Received by Channel <a href="#metadata_received_by_channel" id="metadata_received_by_channel"></a>

Different channels provide different set of Contact’s metadata to IS-Messenger platform. From this channel, you’ll be able to obtain the Contact's phone number.

## Managing WhatsApp Message Templates

{% hint style="warning" %}
Before sending a Template Message to a Contact on the IS-Messenger platform, ensure you did the following:

* Submitted the message template for approval
* Added the approved message template to the Space
  {% endhint %}

### Submitting Message Template for Approval

{% hint style="info" %}
If you do not have an approved message template or would like to submit a new message template, please refer to the following guide.&#x20;
{% endhint %}

**Step 1: Navigate to Twilio**\
Navigate to the [WhatsApp Enabled Senders Page](https://www.twilio.com/console/sms/whatsapp/senders) on Twilio

**Step 2: Select the WhatsApp Approved Phone Number**\
Search for desired phone number and press on it

**Step 3: Submit New Template**\
Scroll down to Message Templates section and press :heavy\_plus\_sign: to submit a new template

### Adding the Approved WhatsApp Message Template to the Space

Once your Message Template has been approved on Twilio, you may proceed to add the message template on the IS-Messenger platform.

**Step 1: Navigate to Channel Settings**\
From **Settings** Module, navigate to the menu item, **Channels**

**Step 2: Locate the Twilio WhatsApp channel**\
Once you have located the Twilio WhatsApp channel, press **Templates**

![Configuring templates for Whatsapp](https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mbui1HRO4dGghy5ITOz%2Fuploads%2Fc01ciiXlBoRd2juAdI36%2Fimage%20\(1\).png?alt=media\&token=c131fe94-47a0-4442-b496-59c53855b0f2)

**Step 3:** Fill in the required information to create a new template.

| **Fields**       | **Type**      | **Description**                                                                                                                                                                                                                            |
| ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Template Name    | Text          | A name used to identify the template                                                                                                                                                                                                       |
| Template Content | Text          | The message template approved by WhatsApp and to be sent to the contact                                                                                                                                                                    |
| Category         | Single select | <p>In which category does this template belong to. <br>Refer <a href="https://www.twilio.com/docs/whatsapp/tutorial/send-whatsapp-notification-messages-templates#whatsapp-notification-categories">here</a> for a list of categories.</p> |
| Language         | Single select | In which language this template is written in                                                                                                                                                                                              |

{% hint style="warning" %}
Make sure to choose one of the three [Meta-approved categories](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/) (Marketing, One-time password and Transactional) as other listed categories will be deprecated.
{% endhint %}

**Step 4: Save changes**\
Review the information and press **SAVE** when it is ready.&#x20;

### **Important Links**

* [Creating message templates](https://www.twilio.com/docs/whatsapp/tutorial/send-whatsapp-notification-messages-templates#creating-message-templates-and-submitting-them-for-approval)
* [Revising rejected message templates](https://www.twilio.com/docs/whatsapp/tutorial/send-whatsapp-notification-messages-templates#revising-rejected-message-templates)
* [Example of approved and rejected message templates](https://www.twilio.com/docs/whatsapp/tutorial/send-whatsapp-notification-messages-templates#examples-of-approved-and-rejected-message-templates)
* [Message guidelines by WhatsApp](https://developers.facebook.com/docs/whatsapp/message-templates/guidelines)

### Rate Limits <a href="#rate_limits" id="rate_limits"></a>

A rate limit is the number of API calls an app or user can make within a given time period defined by the channel. Learn more about the [rate limits for this channel here](https://www.twilio.com/docs/whatsapp/best-practices-and-faqs).
