Developer Documentation

Integrate SMS into your application with our simple REST API.

Quick Start

Send your first SMS in under 2 minutes using any programming language.

1

Get your API Token

Create an account or sign in to get your API token.

2

Choose your method

Use GET for quick tests from browser, or POST for production integration with any language.

3

Send & check response

Make the request and check the JSON response to confirm delivery.

Authentication

Every request needs a valid API token — pass it as a parameter or header.

Your token is available after registration. Include it in every request:

Query String (GET)

?api_token=YOUR_TOKEN

POST Body (recommended)

api_token=YOUR_TOKEN

HTTP Header

Authorization: Bearer YOUR_TOKEN

Send SMS — API Endpoint

Supports both GET and POST methods for maximum flexibility.

Endpoint URL

POST GET https://sms.bd1b.com/api/v1/send

Required Parameters

Parameter Type Required Description
api_token String Yes Your secret API token from dashboard.
phone String Yes Mobile number with country code (e.g. 8801700000000).
message String Yes The SMS text content to deliver.

Code Examples

Production-ready snippets for every language and framework.

GET Request (Browser / Simple)

Just paste this URL into your browser. Replace YOUR_TOKEN, PHONE and MESSAGE with real values.

Browser URL (GET)
https://sms.bd1b.com/api/v1/send?api_token=YOUR_TOKEN&phone=8801700000000&message=Hello+World
cURL (Command Line)
Terminal
# POST method (recommended for production)
curl -X POST https://sms.bd1b.com/api/v1/send \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "api_token=YOUR_TOKEN" \
  -d "phone=8801700000000" \
  -d "message=Hello from cURL"

# GET method (quick test)
curl "https://sms.bd1b.com/api/v1/send?api_token=YOUR_TOKEN&phone=8801700000000&message=Hello"
PHP (cURL & file_get_contents)
PHP
<?php
// POST method using cURL (recommended)
$apiUrl = "https://sms.bd1b.com/api/v1/send";
$data = [
    'api_token' => 'YOUR_TOKEN',
    'phone'     => '8801700000000',
    'message'   => 'Hello from PHP!'
];

$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
if ($result['status'] === 'success') {
    echo "SMS sent successfully!";
} else {
    echo "Error: " . $result['message'];
}

// GET method (simple, for quick tests)
$getUrl = "https://sms.bd1b.com/api/v1/send?api_token=YOUR_TOKEN&phone=8801700000000&message=Hello";
$response = file_get_contents($getUrl);
$result = json_decode($response, true);
echo $result['status'] === 'success' ? 'Sent!' : $result['message'];
?>
JavaScript (Fetch API)
JavaScript
// POST method using Fetch API (Browser / Node.js 18+)
const apiUrl = "https://sms.bd1b.com/api/v1/send";

const formData = new URLSearchParams();
formData.append('api_token', 'YOUR_TOKEN');
formData.append('phone', '8801700000000');
formData.append('message', 'Hello from JavaScript!');

fetch(apiUrl, {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: formData.toString()
})
.then(response => response.json())
.then(data => {
    if (data.status === 'success') {
        console.log('SMS sent successfully!');
    } else {
        console.error('Error:', data.message);
    }
})
.catch(error => console.error('Network error:', error));

// GET method (quick test)
fetch("https://sms.bd1b.com/api/v1/send?api_token=YOUR_TOKEN&phone=8801700000000&message=Hello")
  .then(r => r.json())
  .then(d => console.log(d.status === 'success' ? 'Sent!' : d.message));
Node.js (axios / native https)
Node.js
// Using axios (recommended)
const axios = require('axios');

const apiUrl = "https://sms.bd1b.com/api/v1/send";
const data = new URLSearchParams({
    api_token: 'YOUR_TOKEN',
    phone: '8801700000000',
    message: 'Hello from Node.js!'
});

axios.post(apiUrl, data)
    .then(response => {
        if (response.data.status === 'success') {
            console.log('SMS sent!');
        }
    })
    .catch(error => console.error(error));

// Using native https module (GET method)
const https = require('https');
https.get("https://sms.bd1b.com/api/v1/send?api_token=YOUR_TOKEN&phone=8801700000000&message=Hello", res => {
    let body = '';
    res.on('data', chunk => body += chunk);
    res.on('end', () => console.log(JSON.parse(body)));
});
Laravel (HTTP Client)
Laravel
use Illuminate\Support\Facades\Http;

// POST method (recommended)
$response = Http::asForm()->post('https://sms.bd1b.com/api/v1/send', [
    'api_token' => 'YOUR_TOKEN',
    'phone'     => '8801700000000',
    'message'   => 'Hello from Laravel!',
]);

$result = $response->json();
if ($result['status'] === 'success') {
    // SMS sent successfully!
}

// GET method
$result = Http::get('https://sms.bd1b.com/api/v1/send', [
    'api_token' => 'YOUR_TOKEN',
    'phone'     => '8801700000000',
    'message'   => 'Hello!'
])->json();
Python (requests / urllib)
Python
import requests
import urllib.request
import urllib.parse

# POST method using requests (recommended)
api_url = "https://sms.bd1b.com/api/v1/send"
data = {
    'api_token': 'YOUR_TOKEN',
    'phone': '8801700000000',
    'message': 'Hello from Python!'
}

response = requests.post(api_url, data=data)
result = response.json()

if result['status'] == 'success':
    print('SMS sent successfully!')
else:
    print(f"Error: {result['message']}")

# GET method using urllib
params = urllib.parse.urlencode(data)
full_url = f"{api_url}?{params}"
with urllib.request.urlopen(full_url) as res:
    result = __import__('json').loads(res.read())
    print('Sent!' if result['status'] == 'success' else result['message'])
HTML (Simple Form)

Drop this form into any HTML page — no JavaScript needed.

HTML
<!-- Simple HTML form to send SMS via POST -->
<form action="https://sms.bd1b.com/api/v1/send" method="POST">
    <input type="hidden" name="api_token" value="YOUR_TOKEN">
    
    <label>Phone Number:</label>
    <input type="text" name="phone" placeholder="8801700000000" required>
    
    <label>Message:</label>
    <textarea name="message" placeholder="Your message..." required></textarea>
    
    <button type="submit">Send SMS</button>
</form>

Response Format

Every API response returns JSON with a status and message.

Success (HTTP 200)
{
  "status": "success",
  "message": "SMS sent successfully"
}
Error (HTTP 400/401/402)
{
  "status": "error",
  "message": "Insufficient balance"
}

Error Codes

Quick reference for troubleshooting common issues.

HTTP Code Meaning How to fix
401Invalid or missing API tokenVerify your token on the API Token page
400Missing required parametersEnsure both phone and message are provided
402Insufficient SMS balanceTop up your wallet from the dashboard
500Internal server errorWait a moment and retry, or contact support