REST API orqali SMS yuboring. Barcha so'rovlar JSON formatida.
https://sms.identify.uzHar bir so'rovda API kalitni yuboring (dashboard → "API kalitlar" bo'limidan oling):
Authorization: Bearer sk_live_...
| Maydon | Tavsif |
|---|---|
to | Telefon raqam, masalan +998901234567 (majburiy) |
text | Xabar matni, 1–1000 belgi (majburiy) |
sim | 1 yoki 2 — qaysi SIM (ixtiyoriy) |
ttl | Soniyada amal qilish muddati — o'tsa yuborilmaydi (ixtiyoriy) |
Takror yuborilmasligi uchun Idempotency-Key sarlavhasini qo'shing.
curl -X POST https://sms.identify.uz/v1/messages \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"to":"+998901234567","text":"Salom!"}'
Javob:
{ "id": "a3ce...", "status": "queued", "cost": 9900 }
Holatlar: queued → dispatched → sent → delivered (yoki failed).
{ "messages": [
{ "to": "+998901111111", "text": "Birinchi" },
{ "to": "+998902222222", "text": "Ikkinchi" }
] }
Kodni o'zingiz yaratmaysiz — biz yaratamiz, yuboramiz va tekshiramiz.
curl -X POST https://sms.identify.uz/v1/otp/send \
-H "Authorization: Bearer sk_live_..." \
-d '{"to":"+998901234567"}'
Javob: { "otpId": "...", "status": "queued" }. Ixtiyoriy: length (4–8), ttl (soniya), template ({code} bilan).
curl -X POST https://sms.identify.uz/v1/otp/verify \
-H "Authorization: Bearer sk_live_..." \
-d '{"otpId":"...","code":"123456"}'
Javob: { "verified": true } yoki { "verified": false, "error": "kod noto'g'ri" }. (otpId o'rniga to ham bering.)
| Metod | Yo'l | Tavsif |
|---|---|---|
| GET | /v1/messages/:id | Bitta xabar holati |
| GET | /v1/messages?limit=50&status=sent&search=998 | Ro'yxat (filtr + pagination) |
| GET | /v1/stats | Bugungi statistika |
| GET | /v1/balance | Hisob balansi (tiyin) |
| GET | /v1/inbound | Kelgan SMS'lar |
Xabar holati o'zgarganda (yetkazildi/xato) yoki SMS kelganda sizning serveringizga POST yuboramiz.
{ "url": "https://sizning-server.uz/hook",
"events": ["delivered", "failed", "inbound"],
"secret": "maxfiy_kalit" }
Yuboriladigan payload (X-Signature = HMAC-SHA256(secret, body)):
{ "event": "delivered", "data": { ... }, "timestamp": "..." }
| Kod | Ma'no |
|---|---|
400 | So'rov noto'g'ri (raqam/matn) |
401 | API kalit yo'q yoki noto'g'ri |
402 | Balans yetarli emas |
429 | Juda ko'p so'rov (rate limit) |