Skip to main content

Twilio WhatsApp

Using the WhatsApp Business Platform with Twilio, you can send and receive messages to WhatsApp users using the same Twilio Messaging APIs.

Configuration

Database Setup

Create a new entry in the notify_providers table with the following settings:
FieldValue
channel_type4 (Twilio WhatsApp)
is_enabled1

Configuration Fields

TWILIO_WA_ACCOUNT_SID
string
required
Twilio account SID
TWILIO_WA_AUTH_TOKEN
string
required
Twilio auth token
TWILIO_WA_NUMBER
string
required
Twilio registered WhatsApp phone number
Example Configuration:
{
  "TWILIO_WA_ACCOUNT_SID": "ACapiKeyMsg",
  "TWILIO_WA_AUTH_TOKEN": "some-auth-token",
  "TWILIO_WA_NUMBER": "+15005550006"
}

Request Format

Sample Request Body

{
  "providerId": 4,
  "data": {
    "to": "+919004812051",
    "message": "Your appointment is coming up on July 21 at 3PM"
  }
}

Request Fields

to
string
required
Recipient’s WhatsApp phone number in E.164 format
message
string
required
The WhatsApp message content

Dependencies

PackageVersionDescription
twilio^5.8.0Twilio client for messaging

Reference