curl -X POST https://dark.x-esm.com/api.php \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"numbers": ["201012345678", "201112223333"],
"message": "Hello from API!",
"sender_id": "MyBrand",
"provider": "rund2"
}'
<?php
$api_key = 'YOUR_API_KEY';
$data = [
'numbers' => ['201012345678', '201112223333'],
'message' => 'Hello from API!',
'sender_id' => 'MyBrand',
'provider' => 'rund2'
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://dark.x-esm.com/api.php',
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . $api_key,
'Content-Type: application/json'
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_TIMEOUT => 60
]);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$result = json_decode($response, true);
if ($result['success']) {
echo "✅ تم الإرسال: {$result['sent']} رسالة\n";
echo "💰 التكلفة: \${$result['cost']}\n";
echo "💳 الرصيد: \${$result['balance']}\n";
} else {
echo "❌ فشل: {$result['error']} — {$result['message']}\n";
}
?>
import requests
API_KEY = 'YOUR_API_KEY'
URL = 'https://dark.x-esm.com/api.php'
data = {
'numbers': ['201012345678', '201112223333'],
'message': 'Hello from API!',
'sender_id': 'MyBrand',
'provider': 'rund2'
}
headers = {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
}
response = requests.post(URL, json=data, headers=headers)
result = response.json()
if result.get('success'):
print(f"✅ تم الإرسال: {result['sent']} رسالة")
print(f"💰 التكلفة: ${result['cost']}")
print(f"💳 الرصيد: ${result['balance']}")
else:
print(f"❌ فشل: {result.get('error')} — {result.get('message')}")
const API_KEY = 'YOUR_API_KEY';
const URL = 'https://dark.x-esm.com/api.php';
const data = {
numbers: ['201012345678', '201112223333'],
message: 'Hello from API!',
sender_id: 'MyBrand',
provider: 'rund2'
};
fetch(URL, {
method: 'POST',
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(res => res.json())
.then(result => {
if (result.success) {
console.log(`✅ تم الإرسال: ${result.sent} رسالة`);
console.log(`💰 التكلفة: $${result.cost}`);
console.log(`💳 الرصيد: $${result.balance}`);
} else {
console.error(`❌ فشل: ${result.error} — ${result.message}`);
}
})
.catch(err => console.error('❌ خطأ:', err));