Live Status All Telecom Operator Routes Active (GP, Robi, BL, Airtel, Teletalk) • 99.98% Uptime
Home Features Pricing Developer API About Us Contact Us
Developer API v1.0

RESTful SMS API Documentation

Integrate high-speed SMS dispatch into your PHP, Laravel, Python, Node.js, or mobile applications with guaranteed low-latency delivery.

API Credentials & Authentication

Every request requires your API Key and Secret Key passed via custom HTTP headers.

Required Request Headers
x-api-key: YOUR_PUBLIC_API_KEY
x-secret-key: YOUR_SECRET_KEY
Content-Type: application/json
Accept: application/json
POST https://www.deshisms.com/api/client/send-sms Authentication Required

Description

Sends an SMS to a single recipient mobile number. The message is queued and dispatched directly to the telecommunication operator (Grameenphone, Robi, Banglalink, Airtel, or Teletalk).

Request Body Parameters (JSON)

Parameter Type Requirement Description & Example
caller_id string Required Your registered and approved Sender ID or numeric Sender Name.
e.g. "880961234567" or approved Masking name "BRANDSMS"
to_number string Required Destination mobile number in Bangladesh.
e.g. "8801700000000" or "01700000000" (cleans spaces/hyphens automatically)
message string Required The SMS body content. Full UTF-8 support for English and Bengali/Unicode characters.
e.g. "Your verification OTP code is 492810. Valid for 5 minutes."

Ready Implementation Code

<?php

$curl = curl_init();

$payload = [
    "caller_id" => "880961234567",
    "to_number" => "8801700000000",
    "message"   => "Hello from DeshiSMS! Your verification code is 492810."
];

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://www.deshisms.com/api/client/send-sms',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => json_encode($payload),
    CURLOPT_HTTPHEADER => [
        'x-api-key: YOUR_PUBLIC_API_KEY',
        'x-secret-key: YOUR_SECRET_KEY',
        'Content-Type: application/json',
        'Accept: application/json'
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);

if ($err) {
    echo "cURL Error: " . $err;
} else {
    echo $response;
}
curl --location --request POST 'https://www.deshisms.com/api/client/send-sms' \
--header 'x-api-key: YOUR_PUBLIC_API_KEY' \
--header 'x-secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
    "caller_id": "880961234567",
    "to_number": "8801700000000",
    "message": "Hello from DeshiSMS! Your verification code is 492810."
}'
import requests

url = "https://www.deshisms.com/api/client/send-sms"

headers = {
    "x-api-key": "YOUR_PUBLIC_API_KEY",
    "x-secret-key": "YOUR_SECRET_KEY",
    "Content-Type": "application/json",
    "Accept": "application/json"
}

payload = {
    "caller_id": "880961234567",
    "to_number": "8801700000000",
    "message": "Hello from DeshiSMS! Your verification code is 492810."
}

response = requests.post(url, json=payload, headers=headers)
print("HTTP Status:", response.status_code)
print("Response JSON:", response.json())
const axios = require('axios');

async function sendSms() {
  try {
    const response = await axios.post('https://www.deshisms.com/api/client/send-sms', {
      caller_id: '880961234567',
      to_number: '8801700000000',
      message: 'Hello from DeshiSMS! Your verification code is 492810.'
    }, {
      headers: {
        'x-api-key': 'YOUR_PUBLIC_API_KEY',
        'x-secret-key': 'YOUR_SECRET_KEY',
        'Content-Type': 'application/json',
        'Accept': 'application/json'
      }
    });

    console.log('Success:', response.data);
  } catch (error) {
    console.error('Error:', error.response ? error.response.data : error.message);
  }
}

sendSms();

HTTP Response Codes

HTTP Code Status Sample JSON Response Body
200 OK Success {"status": "success", "message": "SMS has been queued for processing.", "transaction_id": 1042}
401 Unauthorized Auth Failure {"error": "API Key is missing."} or {"error": "Invalid API Key."}
402 Payment Req Low Balance {"error": "Insufficient balance."}
403 Forbidden Invalid Sender ID {"error": "Invalid or unapproved Sender ID."} or {"error": "No SMS package assigned to your account."}
422 Unprocessable Validation Error {"message": "The to number field is required.", "errors": {"to_number": [...]}}
WEBHOOK Delivery Receipt (DLR) Push Notifications

When telecommunication network operators (GP, Robi, BL, Teletalk) deliver an SMS to the subscriber handset, our system captures the Delivery Receipt (DLR) and updates the message status in real-time.

Incoming DLR Endpoint https://www.deshisms.com/api/webhook/dlr
Parameters messageid (ID), text (e.g. DELIVRD)