Mora SMS API
A powerful and easy-to-use SMS API for sending messages, managing sender names, and checking account balances.
https://mora-sa.com/api/v1/
🚀 Introduction
Welcome to the Mora SMS API documentation. Our RESTful API allows you to integrate SMS functionality into your applications with ease. Whether you need to send notifications, verification codes, or marketing messages, our API provides reliable and fast delivery.
Key Features
- Send SMS messages to single or multiple recipients
- Schedule messages for future delivery
- Check account balance in real-time
- Manage sender names
- Comprehensive error handling
- JSON and text response formats
🔐 Authentication
All API requests require authentication using your unique api_key and username.
These parameters must be included in every request.
https://mora-sa.com/api/v1/sendsms?api_key=your_api_key&username=your_username
📱 Sending SMS
Send SMS messages to one or multiple recipients using the /sendsms endpoint.
Endpoint
https://mora-sa.com/api/v1/sendsms
Parameters
| Parameter | Type | Description |
|---|---|---|
message Required |
string | The SMS message content to be sent |
sender Required |
string | The sender name/ID to be used for sending |
numbers Required |
string | Comma-separated list of phone numbers (e.g., "966501234567,966507654321") |
datetime Optional |
string | Schedule message for future delivery (format: YYYY-MM-DD HH:MM:SS) |
return Optional |
string | Response format: "json" (default) or "text" |
Code Examples
curl -X POST "https://mora-sa.com/api/v1/sendsms" \
-d "api_key=your_api_key" \
-d "username=your_username" \
-d "message=Hello from Mora SMS API!" \
-d "sender=YourApp" \
-d "numbers=966501234567,966507654321" \
-d "return=json"
'your_api_key',
'username' => 'your_username',
'message' => 'Hello from Mora SMS API!',
'sender' => 'YourApp',
'numbers' => '966501234567,966507654321',
'return' => 'json'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
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);
echo $response;
?>
import requests
url = 'https://mora-sa.com/api/v1/sendsms'
data = {
'api_key': 'your_api_key',
'username': 'your_username',
'message': 'Hello from Mora SMS API!',
'sender': 'YourApp',
'numbers': '966501234567,966507654321',
'return': 'json'
}
response = requests.post(url, data=data)
print(response.json())
const data = new URLSearchParams({
api_key: 'your_api_key',
username: 'your_username',
message: 'Hello from Mora SMS API!',
sender: 'YourApp',
numbers: '966501234567,966507654321',
return: 'json'
});
fetch('https://mora-sa.com/api/v1/sendsms', {
method: 'POST',
header-moras: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: data
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
💰 Balance Inquiry
Check your account balance using the /balance endpoint.
Endpoint
https://mora-sa.com/api/v1/balance
Code Examples
curl "https://mora-sa.com/api/v1/balance?api_key=your_api_key&username=your_username"
'your_api_key',
'username' => 'your_username'
);
$url .= '?' . http_build_query($params);
$response = file_get_contents($url);
echo $response;
?>
import requests
url = 'https://mora-sa.com/api/v1/balance'
params = {
'api_key': 'your_api_key',
'username': 'your_username'
}
response = requests.get(url, params=params)
print(response.json())
const params = new URLSearchParams({
api_key: 'your_api_key',
username: 'your_username'
});
fetch(`https://mora-sa.com/api/v1/balance?${params}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
👤 Sender Names
Retrieve available sender names for your account using the /sender_names endpoint.
Endpoint
https://mora-sa.com/api/v1/sender_names
Code Examples
curl "https://mora-sa.com/api/v1/sender_names?api_key=your_api_key&username=your_username"
'your_api_key',
'username' => 'your_username'
);
$url .= '?' . http_build_query($params);
$response = file_get_contents($url);
echo $response;
?>
import requests
url = 'https://mora-sa.com/api/v1/sender_names'
params = {
'api_key': 'your_api_key',
'username': 'your_username'
}
response = requests.get(url, params=params)
print(response.json())
const params = new URLSearchParams({
api_key: 'your_api_key',
username: 'your_username'
});
fetch(`https://mora-sa.com/api/v1/sender_names?${params}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
⚠️ Error Codes
The API returns specific error codes to help you troubleshoot issues. Here's a complete list of possible response codes:
| Code | Description |
|---|---|
| 100 | ✅ Numbers received successfully |
| 105 | ❌ Insufficient balance |
| 106 | ❌ Sender name not available |
| 107 | ❌ Sender name is blocked |
| 108 | ❌ No valid numbers for sending |
| 112 | ❌ Message contains prohibited words |
| 114 | ❌ Account is suspended |
| 115 | ❌ Mobile number not activated |
| 116 | ❌ Email not activated |
| 117 | ❌ Empty message cannot be sent |
| 118 | ❌ Sender name is empty |
| 119 | ❌ No recipient number provided |