SMS API
Bitta POST bilan SMS navbatga qo'yiladi; juftlangan telefon uni SIM orqali yuboradi.
Scope'lar: messages:send, messages:read, devices:read. Qayta yuborilgan so'rov ikki marta ketmasligi uchun Idempotency-Key sarlavhasidan foydalaning. Test kalitlar (cv_test_) SIM'ga tegmasdan butun oqimni o'tadi.
SMS
O'z Android telefoningiz orqali SMS navbatga qo'ying, holatini tekshiring, qurilmalar ro'yxatini oling.
Kalitni bearer token sifatida yuboring va xabarni POST qiling; ulangan telefon uni SIM orqali yuboradi. Javob — 202 va xabar id — holatini GET /messages/{id} yoki webhook'lar orqali kuzating.
Har yuborishda Idempotency-Key sarlavhasini bering: o'sha kalit bilan qayta urinish ikkinchi SMS yubormasdan asl javobni qaytaradi. «Sent» — SIM xabarni operatorga topshirdi; «delivered» uchun operator hisoboti kerak, hamma operator ham qaytarmaydi.
Base URL: https://chatvendor.net/api/v1 · har javob {"success": true, "data": …}
POST
/messages
Queue an SMS
messages:send
Ruxsat: messages:send
Parametrlar
Idempotency-Keyheader · stringRetrying with the same key returns the original response instead of sending twice
So'rov tanasi (application/json)
tostringmajburiyInternational format; local numbers need default_region
messagestringmajburiydevice_idstringSend from this phone only — fails rather than silently using another
sim_idstringA specific SIM of that device
prioritystring: low | normal | highhigh jumps the queue; rate limits still apply
client_referencestringYour own id, returned and filterable
schedule_atstring (date-time)Send at this time (ISO 8601)
expires_inintegerSeconds (30–86400): expires instead of arriving late
callback_urlstring (uri)Per-message webhook (unsigned)
consent_categorystring: transactional | otp | notification | marketingdefault_regionstringTwo-letter country for local-format numbers
Javob 202 · SmsMessage
id stringto stringmessage stringstatus string: queued | scheduled | assigned | sent | delivered | failed | cancelled | expireddevice_id stringcreated_at string (date-time)
curl -X POST https://chatvendor.net/api/v1/messages \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
-H "Content-Type: application/json" \
-d '{"to":"+998901234567","message":"Your code is 483921"}'
GET
/messages
List SMS messages
messages:read
Ruxsat: messages:read
Parametrlar
statusquery · stringtoquery · stringdevice_idquery · stringclient_referencequery · stringper_pagequery · integerJavob 200 · SmsMessage[]
id stringto stringmessage stringstatus string: queued | scheduled | assigned | sent | delivered | failed | cancelled | expireddevice_id stringcreated_at string (date-time)
curl https://chatvendor.net/api/v1/messages \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET
/messages/{message}
SMS status and timeline
messages:read
Ruxsat: messages:read
Parametrlar
messagepath · stringmajburiyMessage public id
Javob 200 · SmsMessage
id stringto stringmessage stringstatus string: queued | scheduled | assigned | sent | delivered | failed | cancelled | expireddevice_id stringcreated_at string (date-time)
curl https://chatvendor.net/api/v1/messages/123 \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST
/messages/{message}/cancel
Cancel a queued SMS
messages:send
Ruxsat: messages:send
Parametrlar
messagepath · stringmajburiyMessage public id
Javob 200 · SmsMessage
id stringto stringmessage stringstatus string: queued | scheduled | assigned | sent | delivered | failed | cancelled | expireddevice_id stringcreated_at string (date-time)
curl -X POST https://chatvendor.net/api/v1/messages/123/cancel \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET
/devices
List paired phones
devices:read
Ruxsat: devices:read
Javob 200 · Device[]
id stringname stringstatus stringlast_seen_at string (date-time)
curl https://chatvendor.net/api/v1/devices \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET
/devices/{device}
One device
devices:read
Ruxsat: devices:read
Parametrlar
devicepath · stringmajburiyDevice public id
Javob 200 · Device
id stringname stringstatus stringlast_seen_at string (date-time)
curl https://chatvendor.net/api/v1/devices/{device} \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"