Cascade API
Cascade API އެއްވެސް އެއްވެސް ލިޔުންވާ ސަފްޙާލުން ފަށަން: Telegram bot, Viber bot, Viber Business Messages, RCS, SMS, email އާން push. އަދި އެންމެ ނަޝަވަނީ އެންމެ ލަންސަވަނީ ފަށަން އަށް ފަށަނީ އަށް ފަށަން ވަނީ އެންމެ ލަންސަވަނީ ފަށަނީ ވަނީ އަށް ފަށަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ ވަނީ
Base URL
https://restapi.smsbat.com
OpenAPI / Swagger
The full, machine-readable specification is public:
- Swagger UI: https://restapi.smsbat.com/swagger/index.html
- OpenAPI 3.0 JSON: https://restapi.smsbat.com/swagger/v1/swagger.json
The request schema is LegacyMessageDataDTO; the SMS/other fallback element is LegacyFallbackDTO; the Viber part is LegacyViberMessage; the Telegram part is LegacyTelegramMessageData.
Authentication
Requests are authenticated with headers:
| Header | Purpose |
|---|---|
X-Authorization-Key | Organization API key. Generated in omni.smsbat.com. It is the same key as the one used for https://api.smsbat.com/bat/messagelist. |
X-Viber-Auth-Token | Token of the Viber bot the message is sent through. Required for Viber bot delivery, because an organization can have several bots. |
X-Tg-Bot-Key | Token of the Telegram bot the message is sent through. Required for Telegram bot delivery. |
curl -X POST https://restapi.smsbat.com/api/CascadeMessage/send_message_async \
-H "Content-Type: application/json" \
-H "X-Authorization-Key: <organization key from omni.smsbat.com>" \
-H "X-Viber-Auth-Token: <viber bot token>" \
-d @request.json
Bot tokens are stored in your organization in the SMSBAT panel, but they still have to be sent with every request so the platform knows which bot to use.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/CascadeMessage/send_message_async | Accepts the batch and returns immediately; delivery statuses arrive via callbacks. Recommended. |
| POST | /api/CascadeMessage/send_message | Synchronous variant of the same request. |
| POST | /api/CascadeMessage/send_message/omni-smsbat/tg-viber/async | Cascade with Telegram → Viber priority. |
| GET | /api/CascadeMessage/status_guid/{guid} | SMSBAT messageId އަށް ގެންނޭ މެސެޖްގެ ސްޓެޓުސް. |
| GET | /api/CascadeMessage/status_id/{id} | SMSBAT messageId އަށް ގެންނޭ މެސެޖްގެ ސްޓެޓުސް. |
އެންމެ ކާމެއް
Telegram bot → Viber bot → Viber Business → RCS → SMS
އެއްވެސް އެއްވެސް އެންގާނެވޭ މެސެޖްގެ އެލައިން އެކަށްފަހުން. މައްސަލައިފިލާން ވަނީ ޕްލެޓްފޮރމް އަށް ނިމުންފައިވާ ޗެނަލްތައް އަށް ފެންނަވަނީ؛ ޗެނަލް އެންމެ ފަށަންވާ (އުސަރު ބޮޓްގެ ނިންވާ، ނަންވަނީ Viber ނެތް، މެސެޖް ނިސްވަން) އަށް ނިމޭ ފޮލްބެކް އަށް ފިލާލަނީ. ކޮލްބެކް އަށް ފިންނަވަނީ އެންމެ ޗެނަލް ކުރިއަށް ނިންވާނެ.
އަލުން ނިމޭ ނިސްވަނީ ނަން ނިސްވަނީ:
toPhoneނެތް މެސެޖް ބޮޓްގެ އަށް ފަހުން. Viber Business އާން SMS ފޮނު ނަންވާ ފޮނުވާނެ:toPhoneއަށް މެސެޖްގައި ނެތްfallbacks[]ގެ އަށްtoPhoneއަށް.- ބޮޓް ފަންވަނީ އަށް ނަންވާ ނަންވާ ނަންވާ: Telegram އަށް
tgMessage.chatIdއަށް Viber އަށްviberMessage.receiver. މިއަށް ބޮޓް އަށް އަށްވެސް ފަށަންވާނެ އަށް SMSBAT އަށް ސިንክލް ނެތް.
އެނގާނެވޭ އެލައިން އަށް އަށް
[
{
"id": "ORDER-12345",
"callbackUrl": "https://example.com/smsbat/status",
"fromName": "YourBrand",
"toPhone": "380501234567",
"messageType": "transaction",
"ttl": 60,
"viberMessage": {
"type": "text",
"sender": { "name": "YourBrand" },
"text": "Your order #12345 has been shipped",
"fallbacks": [
{
"messageType": "sms",
"toPhone": "380501234567",
"fromName": "YourBrand",
"ttl": 60,
"text": "Your order #12345 has been shipped"
}
]
}
}
]
ފޯން ނަންވާ: އިންޓަރނޭޝަނަލް ފޮރމެޓް، ނަންވާ ނަންވާ ނަންވާ، + ނެތް (380501234567).
އެންގާނެވޭ ފިލްޑްސް އަށް Send Cascade Messages ސެރޭފްސް ފަހުން.
އަށްވެސް
200 OK އަށް މެސެޖް އަށް އެނގާނެވޭ އޮބޖެކްޓް، އެނގާނެވޭ އަށް އެނގާނެވޭ އަށް.
[
{
"messageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"trackinId": "ORDER-12345"
}
]
messageId— SMSBAT މެސެޖް GUID; އެނގާނެވޭ ވެލޭލް ކޮލްބެކްސްގައިmessage_idއަށް ވަން.trackinId— އަށްވެސްidއަށް ލަންވާނެ؛ ކޮލްބެކްސްގައިtrack_idއަށް ވަން.
400 Bad Request — ހުރި ބޭޕްސް ލަންވާނެ، އަށްވެސް އެނގާނެވޭ ލަންވާނެ؛ އެނގާނެވޭ ލަންވާނެ ނެތް ނިސްވަންވެސް ފެންނަވަން ނެތް.
ޑިލިވަރީ ސްޓެޓުސް
ސްޓެޓުސް އެނގާނެވޭ callbackUrl އަށް އެނގާނެވޭ މެސެޖްގެ (އަށް އޮރގަންސައިޒޭޝަން-ލެވެލް ކޮލްބެކް URL) POST ލިޔެވިފައިވާނެ JSON ބޮޑީ އެނގާނެވޭ އެނގާނެވޭ އޮބޖެކްޓް އެވެ. ފޮރމެޓް، ސްޓެޓުސް އަށް ލަންވާނެ ލަންވާނެ: Delivery Callbacks. އެވެ ލަންވާނެ status_guid / status_id އެނޑްޕޯއިންޓްސްގައި ފެންނަވަން.
ލިމިޓްސް
- ލިޔެވިފައިވާ ބޮޑީ: 10 MB ގެ އަށް.
- އެނގާނެވޭ އެލައިން ގެ މެސެޖްގެ ނަންވާ ސަލަށް ވަނީ ވަނަށް ނެތް؛ ބޮޑީ ސައިސް އެނގާނެވޭ ލިމިޓް އަށް.
- Cascade API ގެ ސެކަންޑްގެ އަންސަރަން ނުވަތަ ނުވަނީ އަލަން ސެކަންޑްގެ ލިމިޓްސް ނޭނގޭ. މެސެޖްތައް އެކަށް އެންމެ ލިޔެވިފައިވާނެ އަށް ގްރޫޕްކުރަނޭ ބޭޓްޗްސްގައި އެންނަން.
މެސެޖް ޓައިޕްސް އަދި ވެލިއާބަލްސް
- މެސެޖް ޓައިޕްސް —
transaction,promo,viber_survey,flashcall. - މެސެޖް ވެލިއާބަލްސް —
%name=id%,%url=id%,%short_url=id%.
ޓެސްޓިންގް
ސެޕަރެޓް ޓެސްޓް އެންވަރިންމަންޓް (sandbox) ނެތެވެ، ކާލްބެކްސް ސިމިލޭޝަން ނެތެވެ. އިންޓެގްރޭޝަންސް ވަނީ ވާނަ އެކަމަށް އަލުންވާ: އަލަށް ސަމާލް ބެޓްޗް އަށް އަލުންވާ ފޮން ނަންބަރު ނަން އަލުން ބޮޓް ޔުސަރުގެ އަލުން ވަންނަވަން callbackUrl އަށް HTTPS އެނޑްޕޯއިންޓް އަށް ވަނަވަނީ. ސްޓެޓިސް އެންމެ ލިޔެވިފައިވާނެ ޑެލިވަރީ ކާލްބެކްސް; ސްޓެޓިސް އަށް GET /api/CascadeMessage/status_guid/{guid} އަށް status_id/{id} އަށް ޕޮލްލްއަށް ވަނީ.