WhatsApp Free-Form Messages API
Overview
The EasySocial WhatsApp Free-Form Messages API allows you to send text and image messages to customers during the active 24-hour customer service window. The document-message example is also provided below.
API Details
| Parameter | Details |
|---|---|
| Endpoint | https://api.easysocial.in/engage/v1/wa-messages/send |
| HTTP Method | POST |
| Authentication Header | auth-key |
| Content Type | application/json |
Authentication
Pass your EasySocial authentication key in the auth-key request header.
Send a Text Message
Request Body
{
"mobile_number": "919999999999",
"type": "text",
"text": "Hello"
}cURL Example
curl -X POST \
"https://api.easysocial.in/engage/v1/wa-messages/send" \
-H "auth-key: YOUR_AUTH_KEY" \
-H "Content-Type: application/json" \
-d '{
"mobile_number": "919999999999",
"type": "text",
"text": "Hello"
}'Parameters
| Parameter | Description |
|---|---|
mobile_number | Customer's WhatsApp mobile number, including the country code. |
type | Message type. Use text for a text message. |
text | Content of the text message. |
Send an Image Message
Request Body
{
"mobile_number": "919999999999",
"type": "image",
"link": "https://cdn.e-so.in/business-assets/business-2/WA-Template-Files/cmraldxd40cx3vsxpgsfohb45.jpeg"
}Parameters
| Parameter | Description |
|---|---|
mobile_number | Customer's WhatsApp mobile number, including the country code. |
type | Message type. Use image for an image message. |
link | URL of the image to be sent. |
Send a Document Message
Use the client API endpoint below to send a document message. The filename field is optional.
Endpoint
https://client-api.e-so.in/engage/v1/wa-messages/send
Request Headers
| Header | Value |
|---|---|
auth-key | Your EasySocial authentication key |
Content-Type | application/json |
Request Payload
{
"mobile_number": "91XXXXXX",
"type": "document",
"link": "DOCUMENT_URL",
"filename": "test"
}Note: Replace DOCUMENT_URL with the actual document URL. The filename field is optional and can be omitted.
Parameters
| Parameter | Description | Required |
|---|---|---|
mobile_number | Customer's WhatsApp mobile number, including the country code. | Yes |
type | Set to document for a document message. | Yes |
link | URL of the document to be sent. | Yes |
filename | Optional filename, for example test. | No |
Meta's 24-Hour Customer Service Window
- The window opens when a customer sends a message to your business.
- Each new message from the customer resets the 24-hour window.
- Your business's replies do not reset the window.
- Once the window expires, an approved WhatsApp message template is required to initiate a new business message.
Example: If a customer messages your business at 10:00 AM on Monday and sends no further messages, the customer service window expires at 10:00 AM on Tuesday.
Meta Media Size and Format Limits
The following limits apply to Meta's WhatsApp Cloud API. They do not independently confirm which media types the EasySocial endpoint supports.
| Media Type | Maximum File Size | Supported Formats |
|---|---|---|
| Image | 5 MB | JPEG, JPG, PNG |
| Video | 16 MB | MP4, 3GP |
| Audio | 16 MB | AAC, AMR, MP3, MP4 audio, OGG (Opus codec) |
| Document | 100 MB | PDF and supported document formats |
| Static Sticker | 100 KB | WebP |
| Animated Sticker | 500 KB | WebP |
Media Format Requirements
- Images: JPEG or PNG.
- Videos: MP4 videos should use H.264 video and AAC audio. 3GP is also supported.
- Audio: OGG audio must use the Opus codec.
- Documents: PDF and other supported document formats must remain within the applicable file size limit.
- Stickers: WebP format is required, with separate limits for static and animated stickers.
Caption Limits
For supported image, video, and document messages, Meta allows captions of up to 1,024 characters.
Important Notes
- Use the customer's mobile number in international format, including the country code.
- Ensure the
auth-keyis valid. - Ensure the media URL is accessible to the service.
- Messages must comply with Meta's WhatsApp Business Messaging Policy.
- Meta's media limits do not guarantee that every media type can be sent through the EasySocial endpoint.
- The supplied EasySocial API examples demonstrate text, image, and document messages. Support for video, audio, and stickers, and their payload fields, must be confirmed against the EasySocial API implementation.