WABA API Developer Reference
Send template messages, custom messages, and files via WhatsApp channel through the iSMS platform. Viber and Messenger coming soon.
Table of Contents
📡 Base URLs
Three endpoint URLs are provided. We recommend using Resource URL 2 or 3 for optimal performance and reliability in production.
https://ww3.isms.com.my/isms_send_waba.phphttps://smtpapi.vocotext.com/isms_send_waba.phpRecommendedhttps://smtpapi2.vocotext.com/isms_send_waba.phpRecommendedContent-Type: application/json header in every request.📱 Supported Channels
💬 Message Types
The Send Message API supports three message types. Template messages (Marketing, Utility, Authentication/OTP) are charged per message and can be sent anytime. Custom/free-text messages and files are only available within an active 24-hour user-initiated window — this is the Service message category, charged per session (not per message).
Send pre-approved Meta message templates with dynamic variable substitution.
✓ Available anytimeSend custom free-text messages to users who have recently messaged your WABA number.
⏱ Within 24-hour windowSend images, PDFs, documents, and other files via a direct publicly accessible URL.
⏱ Within 24-hour window📋 Request Parameters
Complete parameter reference for the Send Message API. Required parameters must be in every request. Conditional parameters depend on message type.
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| AppId | String | Required | Application ID from iSMS console | 8671971xxx |
| AppSecret | String | Required | Application secret from iSMS console | 0b34b7cc... |
| un | String | Required | Your iSMS account username | iSMS |
| pwd | String | Required | Your iSMS account password | iSMS123 |
| agreedterm | String | Required | Must be set to "YES" — confirms acceptance of iSMS Terms | YES |
| ChannelType | String | Required | Message channel. Currently supported: whatsapp. Viber and Messenger coming soon. | whatsapp |
| Type | String | Required | Message type: template, message, or file | template |
| From | String | Required | Sender phone number — must be registered WABA number | 604642xxxx |
| To | String | Required | Recipient phone number in international format | 6018222xxxx |
| TemplateCode | String | Conditional | Template code — required when Type = template | 744c4b5c... |
| Language | String | Conditional | Template language code — required when Type = template | en |
| TemplateParams | Object | Conditional | Template variable values as JSON — when Type = template | {"param1":"val"} |
| Content | String | Conditional | Message text body — required when Type = message | Hello World |
| fileUrl | String | Conditional | Direct public URL to file — required when Type = file | https://... |
| fileName | String | Conditional | Display name for the file — required when Type = file | invoice.pdf |
📤 Send Template Message
Template messages (Marketing, Utility, Authentication/OTP) are pre-approved by WhatsApp and can be sent anytime — ideal for notifications, OTP, reminders, and transactional alerts. These are charged per message regardless of session status.
JSON Request Body
{
"AppId": "8671971xxxxxxx",
"AppSecret": "0b34b7cc0cbxxxxxc",
"un": "your_username",
"pwd": "your_password",
"agreedterm": "YES",
"Type": "template",
"TemplateCode": "90934259xxxxxx",
"TemplateParams": {
"param1": "your value here"
},
"Language": "en",
"From": "604xxxxxxx",
"To": "601X-XXXXXXX"
}PHP Example
<?php $url = "https://smtpapi.vocotext.com/isms_send_waba.php"; $data = [ "AppId" => "your_app_id", "AppSecret" => "your_app_secret", "un" => "your_username", "pwd" => "your_password", "agreedterm" => "YES", "Type" => "template", "TemplateCode" => "your_template_code", "TemplateParams" => ["param1" => date("Y-m-d H:i:s")], "Language" => "en", "From" => "your_waba_number", "To" => "recipient_number" ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $response = curl_exec($ch); if (curl_errno($ch)) { echo "cURL error: " . curl_error($ch); } else { $result = json_decode($response, true); echo "Status: " . $result['statusCode']; echo " | MessageId: " . $result['messageId']; } curl_close($ch); ?>
✉️ Send Custom Message
Send free-form text messages. Only available within the active 24-hour Service session — triggered when a user messages your WABA number first. This session type is charged per 24-hour window, not per individual message.
{
"AppId": "867197xxxx",
"AppSecret": "0b34b7ccxxxx",
"un": "your_username",
"pwd": "your_password",
"agreedterm": "YES",
"Type": "message",
"Content": "Hello! Your appointment is confirmed for tomorrow at 10am.",
"From": "604xxxxxxx",
"To": "601X-XXXXXXX"
}<?php $url = "https://smtpapi.vocotext.com/isms_send_waba.php"; $data = [ "AppId" => "your_app_id", "AppSecret" => "your_app_secret", "un" => "your_username", "pwd" => "your_password", "agreedterm" => "YES", "Type" => "message", "Content" => "Hello! Your appointment is confirmed for tomorrow at 10am.", "From" => "your_waba_number", "To" => "recipient_number" ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $response = curl_exec($ch); echo $response; curl_close($ch); ?>
📎 Send File
Send images, PDFs, and other documents via a direct public URL. The file must be accessible by our servers without authentication.
{
"AppId": "8671971xxxxx",
"AppSecret": "0b34b7cc0cbxxxxx",
"un": "your_username",
"pwd": "your_password",
"agreedterm": "YES",
"Type": "file",
"fileUrl": "https://www.isms.com.my/marketing.png",
"fileName": "marketing_brochure",
"From": "604xxxxxxx",
"To": "601X-XXXXXXX"
}<?php $url = "https://smtpapi.vocotext.com/isms_send_waba.php"; $data = [ "AppId" => "your_app_id", "AppSecret" => "your_app_secret", "un" => "your_username", "pwd" => "your_password", "agreedterm" => "YES", "Type" => "file", "fileUrl" => "https://www.isms.com.my/marketing.png", "fileName" => "marketing_brochure", "From" => "your_waba_number", "To" => "recipient_number" ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $response = curl_exec($ch); echo $response; curl_close($ch); ?>
✅ Response Format
Success Response
| Parameter | Type | Description |
|---|---|---|
| requestId | String | Unique identifier for the API request — use for support enquiries |
| statusCode | String | OK or 0 = success. Any other value indicates failure. See Error Codes. |
| messageId | String | Unique identifier for the sent message — use for delivery status tracking |
❌ Error Codes
General Errors
| Code | Description |
|---|---|
| 0 / OK | Request successful |
| -1 | The system is busy — retry after a short delay |
| 1000 | Unknown error |
| 1001 | Authentication failed — check username and password |
| 1002 | Account suspended or expired |
| 1003 | IP address not allowed |
| 1004 | Insufficient credits |
| 1008 | Missing required parameter |
WABA-Specific Errors
| Code | Description |
|---|---|
| 50500 | Invalid destination phone number |
| 70500 | Invalid WABA account |
| 70501 | Invalid WABA API key |
| 70502 | Insufficient WABA credits |
Application & Session Errors
| Code | Description |
|---|---|
| 40001 | Invalid AppSecret or AccessToken |
| 40008 | Invalid message type |
| 41000 | Required parameter not specified |
| 42001 | Access token expired |
| 45001 | API call limit exceeded |
| 45010 | Reply time limit exceeded (outside 24h window) |
| 47001 | JSON parsing error — check request body format |
| 48001 | Not authorized to call this API |
Template Errors
| Code | Description |
|---|---|
| 60005 | templateCode parameter not specified |
| 60006 | Template code does not exist |
| 60012 | Invalid parameter format |
| 70001 | Scenario sending policy not configured |
📥 Inbound Messages (Webhook)
Receive incoming WhatsApp messages from users via a webhook URL. Contact iSMS support to configure your inbound message callback URL. All parameters are base64 encoded.
Unique identifier for the inbound message
Sender's phone number in international format
Your WABA receiver phone number
Unix timestamp in milliseconds
Display name of the sender
End user's WhatsApp name
Media type: TEXT, LOCATION, DOCUMENT, VIDEO, AUDIO, REPLY, IMAGE, CONTACTS
Message content (format depends on Type)
📬 Delivery Status (Webhook)
Receive real-time delivery status updates via webhook. WhatsApp Business API provides true handset-level delivery tracking — unlike SMS which only confirms Telco SMSC receipt, WABA reports actual message status at the recipient's device.
Unique identifier for the sent message
Sender phone number (your WABA number)
Recipient phone number
Message status: Sent (submitted to WhatsApp), Delivered (confirmed received at recipient's handset), or Read (recipient opened the message). Unlike SMS DLR, WhatsApp delivery status reflects true handset-level confirmation.
Error description if message failed to deliver
📄 Template List API
https://smtpapi.vocotext.com/api_waba_list_template.phpFetch all WhatsApp message templates associated with your account — including type, name, approval status, language, and components. The component field is base64 encoded.
| Parameter | Type | Required | Description |
|---|---|---|---|
| un | String | Required | Your iSMS account username |
| pwd | String | Required | Your iSMS account password |
Success Response
component field is base64 encoded. Use a base64 decoder (or PHP's base64_decode()) to read template component data.PHP Example (POST)
<?php $url = "https://smtpapi.vocotext.com/api_waba_list_template.php"; $data = json_encode(["un" => "your_username", "pwd" => "your_password"]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); $templates = json_decode($response, true); if ($templates['status'] === 'success') { foreach ($templates['data'] as $tpl) { echo $tpl['name'] . " — " . $tpl['auditStatus'] . "\n"; } } curl_close($ch); ?>
💰 Balance API
https://smtpapi.vocotext.com/api_waba_balance.phpCheck your WABA account credit balance. Each WABA account may have multiple phone numbers — the balance for each registered number is returned separately.
Success Response
<?php $url = "https://smtpapi.vocotext.com/api_waba_balance.php"; $data = json_encode(["un" => "your_username", "pwd" => "your_password"]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); $result = json_decode($response, true); if ($result['status'] === 'success') { foreach ($result['data'] as $acct) { echo $acct['waba_number'] . ": MYR " . $acct['waba_credit_balance']; } } curl_close($ch); ?>
Need API Access or Integration Help?
Contact our developer support team — we'll get your AppId, AppSecret, and WABA number configured.
💬 Contact Developer Support →📧 [email protected] · 📞 +603-2780 3880