Asosiy qismga o'tish
ChatVendor ChatVendor

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

Ruxsat: messages:send

Parametrlar

Idempotency-Keyheader · string

Retrying with the same key returns the original response instead of sending twice

So'rov tanasi (application/json)

tostringmajburiy

International format; local numbers need default_region

messagestringmajburiy
device_idstring

Send from this phone only — fails rather than silently using another

sim_idstring

A specific SIM of that device

prioritystring: low | normal | high

high jumps the queue; rate limits still apply

client_referencestring

Your own id, returned and filterable

schedule_atstring (date-time)

Send at this time (ISO 8601)

expires_ininteger

Seconds (30–86400): expires instead of arriving late

callback_urlstring (uri)

Per-message webhook (unsigned)

consent_categorystring: transactional | otp | notification | marketing
default_regionstring

Two-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

Ruxsat: messages:read

Parametrlar

statusquery · string
toquery · string
device_idquery · string
client_referencequery · string
per_pagequery · integer

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 \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /messages/{message} SMS status and timeline

Ruxsat: messages:read

Parametrlar

messagepath · stringmajburiy

Message 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

Ruxsat: messages:send

Parametrlar

messagepath · stringmajburiy

Message 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

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

Ruxsat: devices:read

Parametrlar

devicepath · stringmajburiy

Device 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"