Introduction
Welcome to the HAXOR BULK SMS & Call API. Our RESTful API allows you to send bulk SMS, make voice calls (OBD), and manage your account programmatically.
š Base URL:
All API endpoints are relative to this base URL. HTTP requests will be rejected in production.
https://sms.cathaxor.com/All API endpoints are relative to this base URL. HTTP requests will be rejected in production.
š Authentication
Include your 6-digit API Key in every request header:
X-API-Key: HAX_AB12CD
Or as query parameter:
GET
/api-sms.php?api_key=HAX_AB12CD&number=01XXXXXXXXX&message=Hello
š Your API Key
š± Send Single SMS
POST
/api-sms.php
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes | Your 6-digit API key |
number | String | Yes | Recipient number (01XXXXXXXXX) |
message | String | Yes | SMS content (max 480 chars) |
Example Request (POST)
curl -X POST "https://sms.cathaxor.com/api-sms.php" \
-H "X-API-Key: HAX_AB12CD" \
-d "number=01612345678" \
-d "message=Hello from API!"
Success Response
{
"success": true,
"message": "1 SMS sent",
"data": {
"total_sent": 1,
"cost": "0.20 TK",
"remaining_balance": "48.80 TK"
}
}
Error Response
{
"success": false,
"error": "Insufficient balance. Need 0.20 TK"
}
šØ Send Bulk SMS
POST
/api-sms.php (with comma-separated numbers)
Send SMS to multiple recipients by providing comma-separated phone numbers.
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes | Your 6-digit API key |
number | String | Yes | Comma-separated numbers (01XXXXXXXXX,01XXXXXXXXX) |
message | String | Yes | SMS content (max 480 chars) |
Example Request
curl -X POST "https://sms.cathaxor.com/api-sms.php" \
-H "X-API-Key: HAX_AB12CD" \
-d "number=01612345678,01712345678,01812345678" \
-d "message=Bulk notification to all users!"
Success Response
{
"success": true,
"message": "3 SMS sent",
"data": {
"total_sent": 3,
"cost": "0.60 TK",
"remaining_balance": "49.40 TK"
}
}
š Send Voice Call (OBD)
POST
/api-call.php
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes | Your 6-digit API key |
number | String | Yes | Recipient number (01XXXXXXXXX) |
duration | Integer | No | 10-120 seconds (default: 60) |
voice_url | String | No | Custom audio URL (optional) |
Example Request
curl -X POST "https://sms.cathaxor.com/api-call.php" \
-H "X-API-Key: HAX_AB12CD" \
-d "number=01612345678" \
-d "duration=60"
Success Response
{
"success": true,
"message": "1 call(s) initiated",
"data": {
"total_sent": 1,
"duration": "60 sec",
"cost": "0.40 TK",
"remaining_balance": "49.60 TK"
}
}
š¢ Send Text Call (TTS)
Convert your text to speech and play it to the recipient during the call.
POST
/api-txt-call.php
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes | Your 6-digit API key |
number | String | Yes | Recipient number (01XXXXXXXXX) |
text | String | Yes | Text to be spoken |
duration | Integer | No | 10-120 seconds (default: 60) |
Example Request
curl -X POST "https://sms.cathaxor.com/api-txt-call.php" \
-H "X-API-Key: HAX_AB12CD" \
-d "number=01612345678" \
-d "text=Hello, this is a custom text call" \
-d "duration=60"
Success Response
{
"success": true,
"message": "1 call(s) initiated",
"data": {
"total_sent": 1,
"duration": "60 sec",
"cost": "0.40 TK",
"remaining_balance": "49.60 TK"
}
}
š° Check Balance
GET
/api-balance.php
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes | Your 6-digit API key (header or query) |
Example Request
# Using Header
curl "https://sms.cathaxor.com/api-balance.php" \
-H "X-API-Key: HAX_AB12CD"
# Using Query Parameter
curl "https://sms.cathaxor.com/api-balance.php?api_key=HAX_AB12CD"
Success Response
{
"success": true,
"data": {
"balance": "48.80",
"currency": "TK",
"sms_remaining": 244,
"call_remaining": 122
}
}
ā Error Codes
| Error Message | HTTP Status | Description |
|---|---|---|
API key required | 401 | No API key provided |
Invalid API key | 401 | API key not found in database |
Account blocked | 403 | User account is suspended |
Insufficient balance. Need X TK | 402 | Not enough balance for request |
Number required | 400 | Phone number not provided |
Message required | 400 | SMS message not provided |
šµ Pricing
| Service | Cost | Per |
|---|---|---|
| SMS | 0.20 TK | Per SMS |
| Voice Call | 0.40 TK | Per call (up to 60 sec) |
š» PHP Example
Complete working PHP class with all API methods:
<?php
/**
* HAXOR BULK SMS API Client
*/
class HaxorSMSClient {
private $apiKey;
private $baseUrl;
public function __construct($apiKey, $baseUrl = 'https://sms.cathaxor.com') {
$this->apiKey = $apiKey;
$this->baseUrl = rtrim($baseUrl, '/');
}
// Send SMS (single or bulk)
public function sendSMS($number, $message) {
$data = [
'api_key' => $this->apiKey,
'number' => $number,
'message' => $message
];
return $this->makeRequest('/api-sms.php', $data);
}
// Make voice call
public function makeCall($number, $duration = 60) {
$data = [
'api_key' => $this->apiKey,
'number' => $number,
'duration' => $duration
];
return $this->makeRequest('/api-call.php', $data);
}
// Check balance
public function checkBalance() {
$url = $this->baseUrl . '/api-balance.php?api_key=' . $this->apiKey;
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . $this->apiKey]
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
private function makeRequest($endpoint, $data) {
$ch = curl_init($this->baseUrl . $endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($data),
CURLOPT_HTTPHEADER => ['X-API-Key: ' . $this->apiKey]
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
}
// ===== USAGE EXAMPLES =====
$client = new HaxorSMSClient('HAX_AB12CD');
// Send single SMS
$result = $client->sendSMS('01612345678', 'Hello from PHP!');
if ($result['success']) {
echo "SMS sent! Cost: " . $result['data']['cost'];
}
// Send bulk SMS
$numbers = ['01612345678', '01712345678', '01812345678'];
$bulkResult = $client->sendSMS(implode(',', $numbers), 'Bulk message!');
echo "Sent to " . $bulkResult['data']['total_sent'] . " numbers";
// Check balance
$balance = $client->checkBalance();
echo "Balance: " . $balance['data']['balance'] . " TK";
// Make voice call
$call = $client->makeCall('01612345678', 30);
if ($call['success']) {
echo "Call initiated! Duration: " . $call['data']['duration'];
}
?>
š JavaScript/Node.js Example
const axios = require('axios');
const querystring = require('querystring');
class HaxorSMSClient {
constructor(apiKey, baseUrl = 'https://sms.cathaxor.com') {
this.apiKey = apiKey;
this.baseUrl = baseUrl.replace(/\/$/, '');
this.headers = {
'X-API-Key': apiKey,
'Content-Type': 'application/x-www-form-urlencoded'
};
}
// Send SMS
async sendSMS(number, message) {
const data = { api_key: this.apiKey, number, message };
const res = await axios.post(
`${this.baseUrl}/api-sms.php`,
querystring.stringify(data),
{ headers: this.headers }
);
return res.data;
}
// Make voice call
async makeCall(number, duration = 60) {
const data = { api_key: this.apiKey, number, duration };
const res = await axios.post(
`${this.baseUrl}/api-call.php`,
querystring.stringify(data),
{ headers: this.headers }
);
return res.data;
}
// Check balance
async checkBalance() {
const res = await axios.get(
`${this.baseUrl}/api-balance.php`,
{ headers: this.headers }
);
return res.data;
}
}
// ===== USAGE =====
(async () => {
const client = new HaxorSMSClient('HAX_AB12CD');
try {
// Send SMS
const sms = await client.sendSMS('01612345678', 'Hello from Node.js!');
console.log('SMS Result:', sms);
// Bulk SMS
const bulk = await client.sendSMS(
'01612345678,01712345678',
'Bulk message!'
);
console.log('Bulk Result:', bulk);
// Check balance
const balance = await client.checkBalance();
console.log('Balance:', balance.data);
// Make call
const call = await client.makeCall('01612345678', 30);
console.log('Call Result:', call);
} catch (err) {
console.error('Error:', err.message);
}
})();
š Python Example
import requests
from typing import Dict, List, Optional
class HaxorSMSClient:
"""HAXOR BULK SMS API Client"""
def __init__(self, api_key: str, base_url: str = "https://sms.cathaxor.com"):
self.api_key = api_key
self.base_url = base_url.rstrip('/')
self.headers = {
"X-API-Key": api_key,
"Content-Type": "application/x-www-form-urlencoded"
}
def send_sms(self, number: str, message: str) -> Dict:
"""Send single or bulk SMS"""
url = f"{self.base_url}/api-sms.php"
data = {
"api_key": self.api_key,
"number": number,
"message": message
}
response = requests.post(url, data=data, headers=self.headers)
return response.json()
def send_bulk_sms(self, numbers: List[str], message: str) -> Dict:
"""Send SMS to multiple numbers"""
number_string = ",".join(numbers)
return self.send_sms(number_string, message)
def make_call(self, number: str, duration: int = 60) -> Dict:
"""Make voice call"""
url = f"{self.base_url}/api-call.php"
data = {
"api_key": self.api_key,
"number": number,
"duration": duration
}
response = requests.post(url, data=data, headers=self.headers)
return response.json()
def check_balance(self) -> Optional[Dict]:
"""Check account balance"""
url = f"{self.base_url}/api-balance.php"
response = requests.get(url, headers=self.headers)
result = response.json()
return result.get('data') if result.get('success') else None
# ===== USAGE =====
if __name__ == "__main__":
client = HaxorSMSClient("HAX_AB12CD")
# Send single SMS
result = client.send_sms("01612345678", "Hello from Python!")
if result.get('success'):
print(f"ā
SMS sent!")
print(f"š Total: {result['data']['total_sent']}")
print(f"š° Cost: {result['data']['cost']}")
print(f"š³ Balance: {result['data']['remaining_balance']}")
else:
print(f"ā Error: {result.get('error')}")
# Send bulk SMS
numbers = ["01612345678", "01712345678", "01812345678"]
bulk = client.send_bulk_sms(numbers, "Bulk notification!")
print(f"\nBulk SMS sent to {bulk['data']['total_sent']} numbers")
# Check balance
balance = client.check_balance()
if balance:
print(f"\nš° Balance: {balance['balance']} TK")
print(f"šØ SMS available: {balance['sms_remaining']}")
print(f"š Calls available: {balance['call_remaining']}")
# Make voice call
call = client.make_call("01612345678", 30)
if call.get('success'):
print(f"\nš Call initiated!")
print(f"ā±ļø Duration: {call['data']['duration']}")
print(f"š° Cost: {call['data']['cost']}")
š„ļø cURL Examples
Send Single SMS
curl -X POST "https://sms.cathaxor.com/api-sms.php" \
-H "X-API-Key: HAX_AB12CD" \
-d "number=01612345678" \
-d "message=Hello from cURL!"
Send Bulk SMS
curl -X POST "https://sms.cathaxor.com/api-sms.php" \
-H "X-API-Key: HAX_AB12CD" \
-d "number=01612345678,01712345678,01812345678" \
-d "message=Bulk notification!"
Check Balance (Header)
curl "https://sms.cathaxor.com/api-balance.php" \
-H "X-API-Key: HAX_AB12CD"
Check Balance (Query)
curl "https://sms.cathaxor.com/api-balance.php?api_key=HAX_AB12CD"
Send Voice Call
curl -X POST "https://sms.cathaxor.com/api-call.php" \
-H "X-API-Key: HAX_AB12CD" \
-d "number=01612345678" \
-d "duration=60"
Send Voice Call with Custom Audio
curl -X POST "https://sms.cathaxor.com/api-call.php" \
-H "X-API-Key: HAX_AB12CD" \
-d "number=01612345678" \
-d "duration=30" \
-d "voice_url=https://example.com/audio.mp3"
š Ready to integrate?
Create your free account and get your 6-digit API key instantly with 1 TK bonus!
Create your free account and get your 6-digit API key instantly with 1 TK bonus!