WhatsApp Business API
The APEX Messaging WhatsApp API allows you to send and receive WhatsApp messages, including OTPs, template-based promotions and notifications, using a secure HTTP interface.
The API is built on top of the official WhatsApp Business Platform and supports both immediate and scheduled messaging, delivery reports, and template management.
Base API URL
All WhatsApp API requests are made to:
https://papi.apex-messaging.com
Authentication
All requests require a valid API key.
The API key is passed using the ApiToken parameter in each request.
API keys are created and managed from the APEX Dashboard under Manage API.
IP whitelisting is required for all API keys.
WhatsApp Messaging Model
WhatsApp messages are sent using approved templates.
Templates are created, submitted, and approved before they can be used for outbound messaging.
Common use cases include:
- OTP Authentication
- Account notifications
- Transactional Alerts
- Utility messages
Sending an OTP Message
This endpoint is designed specifically for OTP delivery over WhatsApp.
Endpoint
https://papi.apex-messaging.com/whatsapp/SendOtp
Request Body (JSON)
{
"PhoneNumber": "919906785432",
"OtpCode": "1234",
"ApiToken": "YOUR_API_KEY",
"CallbackUrl": "https://yourdomain.com/whatsapp-dlr",
"TemplateId": 3
}
Parameters
| Parameter | Description | Notes |
| PhoneNumber | Recipient WhatsApp number in international format | eg. 44xxxxx, do not include a + symbol |
| OtpCode | OTP value to be sent | |
| ApiToken | Your API authentication token | Found in the dashboard under Manage API |
| CallbackUrl | Optional URL for delivery status updates | |
| TemplateId | Approved WhatsApp OTP template ID | Found in: Dashboard → WhatsApp → Manage Templates |
Success Response
{
"IsSuccess": true,
"ErrorCode": 0,
"ErrorDescription": "Message Accepted",
"ReturnData": 1099
}
ReturnData contains the generated WhatsAppCampaignId, which can be used to fetch delivery reports.
Sending a Template Message
Template messages allow you to send approved WhatsApp templates to one or more recipients.
This endpoint supports both application/json and multipart/form-data
Use JSON/CURL when sending template messages without media or file-based recipient lists.
Use multipart/form-data when uploading template media or bulk recipient files.
Messages can be sent:
- Immediately
- or scheduled for a future date and time
Endpoint
https://papi.apex-messaging.com/whatsapp/SendMessage
Sending a Template Message (With Media)
multipart/form-data is an HTTP-standard request encoding that allows structured fields and binary files to be transmitted in a single request.
Use this format whenever uploading template media (images, documents) or recipient files (CSV).
| Parameter Name | Type | Description |
|---|---|---|
| ApiToken | String | Required. API token used for authentication. |
| TemplateId | String | Required. ID of the WhatsApp template to be used. |
| QuickNumber | String | Required if QuickNumberFile is not provided. |
| CallbackUrl | String | Optional. Callback URL for delivery status. |
| CampaignName | String | Optional. Name of the campaign. |
| Sample | String | Optional. Sample data to populate the template. |
| ButtonExample | String | Optional. URL for template button (if any). |
| TemplateFile | File | Optional. Template media file. |
| TemplateFileExtension | String | Optional. File extension of template file. |
| QuickNumberFile | File | Required if QuickNumber is not provided. |
| QuickNumberFileExtension | String | Optional. File extension of quick number file. |
| QuickNumberFileColumn | String | Required if QuickNumberFile is provided. |
| IsScheduled | Boolean | Optional. Schedule message delivery. |
| TimeZoneId | Byte | Required if IsScheduled is true. |
| FinalEffectiveDate | DateTime | Required if IsScheduled is true. |
| FinalEffectiveTime | TimeSpan | Required if IsScheduled is true. |
Request Body (multipart/form-data)
curl -X POST https://api.apex-messaging.com/whatsapp/send \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "TemplateId=template_12345" \
-F "QuickNumber=971501234567" \
-F "CallbackUrl=https://client.example.com/whatsapp/dlr" \
-F "CampaignName=April Promo Campaign" \
-F "Sample=John Doe,Order12345" \
-F "ButtonExample=https://www.example.com/track" \
-F "TemplateFile=@promo-image.jpg" \
-F "TemplateFileExtension=jpg" \
-F "IsScheduled=true" \
-F "TimeZoneId=2" \
-F "FinalEffectiveDate=2025-04-28" \
-F "FinalEffectiveTime=23:12:00"
Bulk send example (using a number file)
curl -X POST https://api.apex-messaging.com/whatsapp/send \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "TemplateId=template_12345" \
-F "QuickNumberFile=@recipients.csv" \
-F "QuickNumberFileExtension=csv" \
-F "QuickNumberFileColumn=phonenumber" \
-F "CampaignName=Bulk WhatsApp Campaign" \
-F "Sample=Jane,Invoice9981" \
-F "TemplateFile=@document.pdf" \
-F "TemplateFileExtension=pdf"
Sending Template Message (No Media)
You can use JSON or CURL when sending template messages without media or file-based recipient lists.
{
"ApiToken": "YOUR_TOKEN_HERE",
"TemplateId": "",
"QuickNumber": "35699384535",
"CallbackUrl": "https://webhook.site/DLRS",
"CampaignName": "Variable 1, Variable 2",
"Sample": "Variable 1, Variable 2",
"ButtonExample": "https://apex-messaging.com/example",
"TemplateFile": "abcd",
"TemplateFileExtension": "jpg" or "png",
"QuickNumberFile": "abcd",
"QuickNumberFileExtension": "csv",
"QuickNumberFileColumn": "Number",
"IsScheduled": true,
"TimeZoneId": 2,
"FinalEffectiveDate": "2025-04-28",
"FinalEffectiveTime": "23:12:00",
"ActualScheduleDateTime": "2025-04-28T23:12:00"
}
