SMS API Docs
v1

Muthobarta SMS API

Muthobarta is a leading A2P SMS aggregator providing reliable, high-throughput messaging across Bangladesh. This documentation covers the SMS sending API, including both GET and POST methods, with complete PHP code samples ready to integrate.

Send SMS
Two methods — simple GET or structured POST via JSON body
🔑
Token Auth
Authenticate via token — query param or Authorization header
🇧🇩
Unicode Ready
Supports Bengali Unicode messages out of the box

All API requests must be made over HTTPS. Plain HTTP connections are not accepted. SSL peer verification can be disabled in cURL for development environments, but should be enabled in production.

Authentication

The Muthobarta API uses token-based authentication. Your API token must be included with every request. Depending on which method you use, the token is passed differently.

GET Requests

Pass your token as a query parameter:

?token=YOUR_API_TOKEN

POST Requests

Pass your token in the Authorization HTTP header:

Authorization: Token YOUR_API_TOKEN

Never expose your API token in client-side code or public repositories. Always keep it server-side. Contact Muthobarta support if your token is compromised.

Base URL

All API endpoints are served from the following base URL:

https://sysadmin.muthobarta.com/api/v1/

GET Send SMS via GET

Send a single SMS message using a simple HTTP GET request with query parameters. This method is ideal for quick integrations and testing.

GET /send-sms-get

Query Parameters

Parameter Type Required Description
token string required Your unique API authentication token provided by Muthobarta.
receiver string required The recipient's mobile number (e.g. 01730586226). Bangladeshi format without country code prefix.
message string required The SMS message text. Must be URL-encoded before sending. Supports Bengali Unicode characters.
remove_duplicate boolean optional If true, prevents duplicate messages from being sent to the same number. Default: false.

Always URL-encode the message parameter before appending it to the query string. Use rawurlencode() in PHP to handle Bengali Unicode and special characters correctly.

Example Request URL

https://sysadmin.muthobarta.com/api/v1/send-sms-get?token=YOUR_TOKEN&receiver=01730586226&message=%E0%A6%AC%E0%A6%BE%E0%A6%82%E0%A6%B2%E0%A6%BE%E0%A6%A6%E0%A7%87%E0%A6%B6&remove_duplicate=true

POST Send SMS via POST

Send a single SMS message using an HTTP POST request with a JSON body. This is the recommended method for production integrations as it supports cleaner handling of Unicode content and larger payloads.

POST /send-sms

Request Headers

Header Value Required
Content-Type application/json required
Authorization Token YOUR_API_TOKEN required

Request Body Parameters

Parameter Type Required Description
receiver string required The recipient's mobile number. Example: "01842949645".
message string required The SMS message text. Bengali Unicode is fully supported — no encoding needed with JSON.
remove_duplicate boolean optional Pass true to suppress duplicate SMS delivery to the same receiver.

Example Request Body

{} JSON
{
  "receiver": "01842949645",
  "message": "ইহা একটি টেস্ট এস এম এস",
  "remove_duplicate": true
}

GET PHP Code Sample

Complete PHP implementation using cURL to send an SMS via the GET endpoint.

PHP — GET Method
<?php

$token            = "";         // Your API token
$remove_duplicate = true;
$receiver         = '01730586226';
$message          = 'বাংলাদেশ একটি সুন্দর দেশ';

$data = sendSMS($token, $receiver, $message, $remove_duplicate);
print_r($data);

function sendSMS($token, $receiver, $message, $remove_duplicate)
{
    // URL-encode the message (required for Bengali / Unicode text)
    $message = rawurlencode($message);

    $url = "https://sysadmin.muthobarta.com/api/v1/send-sms-get"
         . "?token=$token"
         . "&receiver=$receiver"
         . "&message=$message"
         . "&remove_duplicate=$remove_duplicate";

    $c = curl_init();
    curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($c, CURLOPT_URL, $url);
    curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);

    $response = curl_exec($c);
    return $response;
}
?>

POST PHP Code Sample

Complete PHP implementation using cURL to send an SMS via the POST endpoint with a JSON body and Authorization header.

PHP — POST Method
<?php

// API endpoint
$url = 'https://sysadmin.muthobarta.com/api/v1/send-sms';

// Initialize cURL
$ch = curl_init($url);

// Build the request payload
$data = array(
    "receiver"         => "01842949645",
    "message"          => "ইহা একটি টেস্ট এস এম এস",
    "remove_duplicate" => true
);
$postdata = json_encode($data);

// Set POST fields (JSON encoded)
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);

// Set required headers
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Authorization: Token YOUR_API_TOKEN'   // <-- Replace with your token
));

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

// Execute and close
$result = curl_exec($ch);
curl_close($ch);

var_dump($result);
?>

Response Codes

The API returns standard HTTP status codes along with a JSON response body indicating the result of your request.

200 SUCCESS SMS sent successfully
{ "status": "success", "message": "SMS sent successfully" }
401 UNAUTHORIZED Invalid or missing token
{ "status": "error", "message": "Unauthorized. Invalid token." }
400 BAD REQUEST Missing or invalid parameters
{ "status": "error", "message": "Receiver number is required." }

Notes & Tips

Bengali Unicode Messages

For the GET API, always use rawurlencode() on your message before embedding it in the URL. The POST method with JSON handles Unicode natively — no manual encoding needed.

Choosing GET vs POST

Use GET for quick scripts and testing. Use POST for production applications — it avoids URL length limits, handles Unicode cleanly in the JSON body, and follows REST best practices for state-changing operations.

Duplicate Prevention

Setting remove_duplicate to true prevents the same message from being delivered more than once to the same receiver within a short window — useful for notification systems.

SSL in Production

The sample code disables SSL peer verification (CURLOPT_SSL_VERIFYPEER = false) for convenience. In production, set this to true and ensure your server has a valid CA bundle configured.


For support, contact at support@muthofun.com