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.
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:
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.
Query Parameters
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
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.
Request Headers
Request Body Parameters
Example Request Body
{
"receiver": "01842949645",
"message": "ইহা একটি টেস্ট এস এম এস",
"remove_duplicate": true
}
GET PHP Code Sample
Complete PHP implementation using cURL to send an SMS via the GET endpoint.
<?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 // 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.
Notes & Tips
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.
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.
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.
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