Complete API Reference

API DocumentationSMS • Voice OTP • WhatsApp • Telegram

Everything you need to integrate Net2APP into your application. RESTful SMS API, Voice OTP API, WhatsApp & Telegram APIs, and SMS Routing API — with code examples in Node.js, Python, and PHP.

📨

SMS API

POST
/api/send-sms

Send a single or bulk SMS message. Supports Unicode, alphanumeric sender IDs, and DLR tracking.

POST
/api/rcs/send

Send RCS (Rich Communication Services) messages with images, buttons, carousels, and branded templates.

POST
/api/flash-sms

Send Class 0 Flash SMS messages that appear as screen pop-ups without saving to the inbox.

GET
/api/sms/status/:messageId

Check the delivery status of a previously sent SMS message. Returns DLR status and timestamps.

GET
/api/sms/history

Retrieve SMS sending history with pagination, date filtering, and status filtering.

📞

Voice OTP API

POST
/api/voice-otp/send

Initiate a Voice OTP call to a phone number. Supports numeric and alphanumeric OTPs with 3-retry logic.

GET
/api/voice-otp/status/:callId

Check the status of a Voice OTP call — ringing, answered, completed, or failed.

GET
/api/voice-otp/logs

Retrieve Voice OTP call logs with duration, retry counts, and status details.

💬

WhatsApp & Telegram API

POST
/api/ott/whatsapp/send

Send a WhatsApp text message via the Baileys WhatsApp Web protocol to any phone number.

POST
/api/ott/whatsapp/media

Send images, videos, audio, or documents through WhatsApp with automatic media processing.

POST
/api/ott/telegram/send

Send a Telegram message via MTProto API with higher rate limits than the Bot API.

POST
/api/ott/telegram/media

Send media files through Telegram with automatic compression and format handling.

🔀

SMS Routing API

POST
/api/routing/plans

Create a new SMS routing plan. Define routing strategy with ordered routes, trunks, and suppliers.

GET
/api/routing/plans

List all SMS routing plans for the tenant with status, priorities, and configuration details.

GET
/api/routing/suppliers

List configured SMS suppliers with connection status, throughput, and delivery success rates.

🪝

Webhooks

POST
/your-callback-url (DLR)

Receive DLR delivery report callbacks. Net2APP POSTs JSON payload with message ID, status, timestamp, and error codes.

POST
/your-callback-url (Voice)

Receive Voice OTP call status callbacks. Payload includes call ID, status, duration, and retry count.

POST
/your-callback-url (Inbound)

Receive inbound SMS messages. Net2APP forwards incoming messages to your registered webhook URL.

Authentication & Security

All APIs require authentication — choose the method that fits your security requirements

API Key Authentication

Include your unique API key in the X-API-Key request header or as an api_key query parameter. API keys are generated from the Net2APP dashboard.

curl -X POST https://net2app.com/api/send-sms \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"+1234567890","message":"Hello"}'

IP Whitelisting

Restrict API access to specific IP addresses for enhanced security. Configure IP whitelists per API key from the dashboard. Supports IPv4 and CIDR notation.

# Dashboard → Settings → IP Whitelisting
# Add: 203.0.113.50 (single IP)
# Add: 203.0.113.0/24 (CIDR range)

Rate Limiting

Per-API-key rate limits control throughput. Configure TPS (transactions per second), daily caps, and concurrent connections. Rate limit headers included in all API responses.

# Response headers:
X-RateLimit-Limit: 50
X-RateLimit-Remaining: 42
X-RateLimit-Reset: 1640000000
Retry-After: 60

Code Examples

Send your first SMS in minutes with these quick-start code examples

Node.jsQuick Start
const axios = require('axios');

async function sendSMS(to, message) {
  const response = await axios.post(
    'https://net2app.com/api/send-sms',
    { to, message, sender_id: 'NET2APP' },
    { headers: { 'X-API-Key': 'YOUR_API_KEY' } }
  );
  return response.data;
}

// Usage
sendSMS('+1234567890', 'Hello from Net2APP!')
  .then(console.log)
  .catch(console.error);
PythonQuick Start
import requests

def send_sms(to, message):
    response = requests.post(
        "https://net2app.com/api/send-sms",
        json={"to": to, "message": message, "sender_id": "NET2APP"},
        headers={"X-API-Key": "YOUR_API_KEY"}
    )
    return response.json()

# Usage
result = send_sms("+1234567890", "Hello from Net2APP!")
print(result)
PHPQuick Start
<?php

function sendSMS($to, $message) {
    $ch = curl_init('https://net2app.com/api/send-sms');
    curl_setopt_array($ch, [
        CURLOPT_POST => true,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'X-API-Key: YOUR_API_KEY',
            'Content-Type: application/json'
        ],
        CURLOPT_POSTFIELDS => json_encode([
            'to' => $to,
            'message' => $message,
            'sender_id' => 'NET2APP'
        ])
    ]);
    $result = curl_exec($ch);
    curl_close($ch);
    return json_decode($result, true);
}

// Usage
$result = sendSMS('+1234567890', 'Hello from Net2APP!');
print_r($result);

DLR & Webhook Integration

Real-time message status updates via webhook callbacks

DLR Status Codes

ENROUTEMessage accepted and queued for delivery
DELIVEREDMessage successfully delivered to handset
UNDELIVERABLEMessage could not be delivered after retries
EXPIREDMessage TTL expired before delivery
REJECTEDMessage rejected by carrier or supplier
DELETEDMessage deleted from queue before sending

Webhook Payload Format

{
  "message_id": "msg_abc123",
  "status": "DELIVERED",
  "timestamp": "2025-01-15T10:30:00Z",
  "to": "+1234567890",
  "error_code": null,
  "error_description": null
}

Configure your webhook URL in the Net2APP dashboard. Net2APP POSTs JSON payloads to your endpoint whenever message status changes.

Start Building with Our APIs

Deploy your SMS gateway in 60 seconds and get instant API access. All endpoints, all features — free to start.