🚀 Overview
Free-form text reply with optional URL preview.
Send one publicly accessible image or document URL.
Available only for accounts with an enabled Messenger template.
🔗 API Endpoint
https://www.isms.com.my/isms_send_messenger.phpRecommendedhttps://smtpapi.vocotext.com/isms_send_messenger.phphttps://smtpapi2.vocotext.com/isms_send_messenger.php| Setting | Value |
|---|---|
| Content-Type | application/json |
| Method | POST only |
| Encoding | UTF-8 JSON |
| Recipients | 1 to 20 comma-separated PSIDs |
🔐 Authentication
🧩 Request Parameters
| Parameter | Type | Requirement | Description |
|---|---|---|---|
| AppId | String | REQUIRED | Messenger application ID supplied for the account. |
| AppSecret | String | REQUIRED | Messenger application secret. |
| un | String | REQUIRED | Account username. Main and authorised subuser credentials are supported. |
| pwd | String | REQUIRED | Account password. |
| agreedterm | String | CONDITIONAL | Use YES when API terms are not already accepted. |
| Type | Enum | REQUIRED | message, file, or template. |
| From | String | REQUIRED | Your registered Facebook Page ID. |
| To | String | REQUIRED | Customer PSID. For multiple recipients, separate up to 20 PSIDs with commas. |
| Message | String | CONDITIONAL | Text body. Required when Type is message. |
| fileUrl | String | CONDITIONAL | Public HTTPS URL of the file. Required when Type is file. |
| fileName | String | CONDITIONAL | Final file name shown to the customer, with the correct extension. |
| TemplateCode | String | CONDITIONAL | Enabled template code. Required when Type is template. |
💬 Send Text
message and provide the text body.{
"AppId": "YOUR_APP_ID",
"AppSecret": "YOUR_APP_SECRET",
"un": "your_username",
"pwd": "your_password",
"agreedterm": "YES",
"Type": "message",
"From": "379920865198163",
"To": "28493227163613907",
"Message": "Hello! Thanks for messaging our Page — how can we help?"
}PHP example
<?php $payload = json_encode([ 'AppId' => 'YOUR_APP_ID', 'AppSecret' => 'YOUR_APP_SECRET', 'un' => 'your_username', 'pwd' => 'your_password', 'agreedterm' => 'YES', 'Type' => 'message', 'From' => '379920865198163', 'To' => '28493227163613907', 'Message' => 'Hello from our Page!' ], JSON_UNESCAPED_UNICODE); $ch = curl_init('https://www.isms.com.my/isms_send_messenger.php'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_HTTPHEADER => ['Content-Type: application/json'], CURLOPT_POSTFIELDS => $payload, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30 ]); $response = curl_exec($ch); if ($response === false) { throw new RuntimeException(curl_error($ch)); } curl_close($ch); $result = json_decode($response, true); if (($result['statusCode'] ?? null) === 0 && !empty($result['messageId'])) { echo 'Accepted: '.$result['messageId']; } else { echo 'Not accepted: '.$response; } ?>
📎 Send File
file and provide a public HTTPS URL plus the final file name.{
"AppId": "YOUR_APP_ID",
"AppSecret": "YOUR_APP_SECRET",
"un": "your_username",
"pwd": "your_password",
"agreedterm": "YES",
"Type": "file",
"From": "379920865198163",
"To": "28493227163613907",
"fileUrl": "https://example.com/files/invoice.pdf",
"fileName": "invoice.pdf",
"MessageType": "FILE"
}🧱 Template Mode
{
"AppId": "YOUR_APP_ID",
"AppSecret": "YOUR_APP_SECRET",
"un": "your_username",
"pwd": "your_password",
"agreedterm": "YES",
"Type": "template",
"From": "379920865198163",
"To": "28493227163613907",
"TemplateCode": "YOUR_TEMPLATE_CODE",
"Language": "en",
"TemplateParams": [{ "name": "Customer" }]
}✅ Response Format
{
"requestId": "841c4247-6cb1-4d85-bf4c-b0084503ac86",
"statusCode": 0,
"messageId": "2026071235388571360206848",
"messageInstanceId": "2026071235388571360206848",
"charge": "0.020",
"currency": "MYR"
}| Field | Description |
|---|---|
| requestId | Request trace identifier for support and troubleshooting. |
| statusCode | 0 means accepted. Any other value is not accepted. |
| messageId | Primary ID used to correlate delivery callbacks. |
| messageInstanceId | Additional submission identifier for diagnostics. |
| charge / currency | Credits charged for the accepted request. Failed requests return zero charge. |
❌ Error Codes
resultCode and errorMessage.HTTP and general errors
Messenger errors
{
"resultCode": 70603,
"errorMessage": "Invalid Destination PSID"
}📥 Inbound Message Webhook
[{
"From": "28493227163613907",
"Message": "Hi",
"MessageId": "2026071236821556319162368",
"Timestamp": 1783992845172,
"To": "379920865198163",
"Type": "TEXT"
}]Media Message field
"Message": "{\"filename\":\"photo.jpg\",\"animated\":false,\"url\":\"https://example.com/photo.jpg\"}"
📬 Delivery Status Webhook
[{
"ConversationId": "123686334931625574494509",
"From": "379920865198163",
"MessageId": "2026071236863344861163520",
"MsgFrameType": "message",
"Status": "Delivered",
"Timestamp": 1784002812674,
"To": "28493227163613907",
"Type": "TEXT"
}]🛡 Integration Best Practices
Require statusCode 0 and a messageId before marking a send accepted.
Persist message IDs and ignore repeated inbound or delivery events.
Return HTTP 200 promptly and process webhook business logic asynchronously when possible.
Store secrets server-side and rotate them if exposed.
Keep identifiers as strings; never apply telephone-number formatting.
Store requestId, messageId, Page ID and recipient PSID for support.
Need Your API Credentials?
AppId and AppSecret are issued when your Messenger channel is activated. Contact us to activate the channel and get your credentials.
Contact Sales / Activate Messenger →