🏠 Home ℹ️ About Us
📩 Contact Us 🔔 Notice
🔑 Log In 📝 Free Sign Up
HomeAPI & DevSend SMS with Node.js

Send SMS with 🟢 Node.js

Integrate iSMS bulk SMS into your Node.js application using the built-in https module — no external dependencies required.

Node.js · https module HTTPS POST v2.1
⚠️
IP whitelist required. Every API request must originate from a whitelisted server IP. Email support@mobiweb.com.my to whitelist your IP before your first call — non-whitelisted requests are rejected with -1003.
ℹ️
You will also need to register a free iSMS account and purchase SMS credits. Full parameters, response codes and delivery callbacks are in the SMS API documentation.
API Endpoints
Classic HTTPS GET / POST — point your integration at the primary
// 1 — PRIMARY — use this
https://www.isms.com.my/isms_send_all_id.php
// 2 — Mirror — backup only
https://smtpapi2.vocotext.com/isms_send_all_id.php
// 3 — Mirror — backup only
https://smtpapi.vocotext.com/isms_send_all_id.php
// 4 — Mirror — backup only
https://ww3.isms.com.my/isms_send_all_id.php
ℹ️
Use www.isms.com.my as your production endpoint. The other hosts are mirrors for failover only — switch to one automatically if the primary is unreachable, but do not point your integration at a mirror by default.
💡
Sending different text to each recipient? The newer JSON API (isms_send_json.php) takes up to 50 recipients per call, each with its own message, and returns structured per-recipient results. Same credentials, same sender IDs, same whitelist.
Send a Single SMS
Node.js · https module POST
const https = require('https');
const querystring = require('querystring');

const params = querystring.stringify({
  un:          'your_username',   // iSMS account username
  pwd:         'your_password',   // iSMS account password
  dstno:       '601X-XXXXXXX',    // Recipient — full international format
  msg:         'Hello from iSMS!',
  type:        '1',              // 1 = ASCII (English/BM), 2 = Unicode (Chinese/Arabic)
  agreedterm:  'YES',
  sendid:      'MyBrand'         // Optional sender ID (max 11 chars)
});

const options = {
  hostname: 'www.isms.com.my',
  path:     '/isms_send_all_id.php',
  method:   'POST',
  headers: {
    'Content-Type':   'application/x-www-form-urlencoded',
    'Content-Length': Buffer.byteLength(params)
  }
};

const req = https.request(options, (res) => {
  let data = '';
  res.on('data', chunk => data += chunk);
  res.on('end', () => {
    if (data.includes('2000')) {
      const trxId = data.split(':')[1];
      console.log('SMS sent! Transaction ID:', trxId);
    } else {
      console.error('Failed:', data); // e.g. -1004 = INSUFFICIENT CREDITS
    }
  });
});

req.on('error', err => console.error('Connection error:', err.message));
req.write(params);
req.end();
Multiple Recipients
Separate multiple numbers with semicolons ; — recommended max 30 per call.
Node.js · Multiple Recipients
const recipients = ['601X-XXXXXXX', '601X-XXXXXXX', '601X-XXXXXXX'];

const params = querystring.stringify({
  un:         'your_username',
  pwd:        'your_password',
  dstno:      recipients.join(';'),   // Semicolon-separated
  msg:        'Dear customer, your order is ready!',
  type:       '1',
  agreedterm: 'YES'
}); // ... same https.request() as above
✅ Success
2000 = SUCCESS:1143007207
// 1143007207 is the TRX_ID — store it
// to match delivery callbacks later
❌ Error codes
-1000 UNKNOWN ERROR
-1001 AUTHENTICATION FAILED
-1002 ACCOUNT SUSPENDED / EXPIRED
-1003 IP NOT ALLOWED
-1004 INSUFFICIENT CREDITS
-1005 INVALID SMS TYPE
-1006 INVALID BODY LENGTH
-1007 INVALID HEX BODY
-1008 MISSING PARAMETER
-1009 INVALID MESSAGE CONTENT
-1010 MAX DESTINATION NUMBERS EXCEEDED
-1012 INVALID MESSAGE TYPE
-1013 INVALID TERM AGREEMENT
⚠️
Delivery status scope (Malaysia): a 2000 response confirms submission to the Telco SMSC only — not delivery to the handset. Malaysian telcos do not provide handset-level DLR by default. For confirmed Sent → Received → Read tracking, consider WhatsApp Business API.

Ready to Integrate?

Register free, get your API credentials, and start sending in minutes.

📱 SMS Coverage — Every Country We Reach Jump to a country's rate by first letter

A B C D E F G H I J K L M N O P Q R S T U V Y Z