المطورون
API SMS
ادمج SMS عبر REST API.
🚀 بداية سريعة
- 01.أنشئ حسابك واطلب مفتاح API
- 02.استخدم المفتاح في الهيدر
Authorization: Bearer SUA_API_KEY - 03.أرسل طلب POST
BASE URL
https://api.smsgratis.online
نقاط النهاية
POST
/v1/sendPOST
/v1/send-bulkGET
/v1/balanceGET
/v1/status/:idGET
/v1/historyأمثلة الكود
curl
curl -X POST https://api.smsgratis.online/v1/send \
-H "Authorization: Bearer SUA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "5511999999999", "message": "Hello!"}'python
import requests
response = requests.post(
"https://api.smsgratis.online/v1/send",
headers={"Authorization": "Bearer SUA_API_KEY"},
json={"to": "5511999999999", "message": "Hello!"}
)
print(response.json())javascript
const response = await fetch("https://api.smsgratis.online/v1/send", {
method: "POST",
headers: {"Authorization": "Bearer SUA_API_KEY", "Content-Type": "application/json"},
body: JSON.stringify({to: "5511999999999", message: "Hello!"})
});
const data = await response.json();php
<?php
$ch = curl_init("https://api.smsgratis.online/v1/send");
curl_setopt_array($ch, [
CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer SUA_API_KEY", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode(["to" => "5511999999999", "message" => "Hello!"])
]);
echo curl_exec($ch);الاستجابة
JSON RESPONSE
{
"success": true,
"id": "sms_abc123",
"status": "sent",
"credits_used": 1
}