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.
Please note that there are requirements of registration and verification requirements before being able to execute messaging on the WhatsApp Business API. For more information about the prerequisites, please visit the WhatsApp Business Platform Access page of the Developer Hub.
Base API URL
All WhatsApp API requests are made to:
https://papi.apex-messaging.com/whatsapp
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": "35699999999",
"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": 001
}
ReturnData contains the generated WhatsAppCampaignId, which can be used to fetch delivery reports.
Sending a Template Message (Non-OTP)
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 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://papi.apex-messaging.com/whatsapp/sendmessage \
-H "Authorization: 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://papi.apex-messaging.com/whatsapp/sendmessage \
-H "Authorization: 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 multipart/form-data when sending template messages without media or file-based recipient lists.
{
"ApiToken": "YOUR_TOKEN_HERE",
"TemplateId": "873646267282931",
"QuickNumber": "35699384535",
"CallbackUrl": "https://webhook.site/DLRS",
"CampaignName": "ABC",
"Sample": "Variable 1, Variable 2",
"ButtonExample": "https://apex-messaging.com/example",
}
Please note that this API document is a work in progress; we will be adding the responses and error codes in due course. If you require further details, please do not hesitate to contact your account manager or our general support.
