Cascade ލިޔުންސް ފޮނުވޭނެ
Telegram bot, Viber bot, Viber Business Messages, RCS އަދި SMS ގެ އެކަން ލިޔުންސް އަށް ގައިވާ ލެންސް ފަށަން. އެންމެ ސްކީމާ އަށް ފަށަންވާނެ Swagger specification (LegacyMessageDataDTO).
އެނޑްޕޯއިންޓް
POST https://restapi.smsbat.com/api/CascadeMessage/send_message_async
send_message_async ލިޔުންސް އަށް ފަށަންވާނެ އަދި އެންމެ އަށް ނިމުންވާނެ؛ ފިލާވަންވާ ސްޓެޓިސް އަށް callbacks ގެ ގައިވާނެ. އެންމެ ސިންކްރޮނަސް POST /api/CascadeMessage/send_message އަށް ވެސް އެންމެ POST /api/CascadeMessage/send_message/omni-smsbat/tg-viber/async އަށް ފަށަންވާނެ ކާސެޑެޑް އަށް Telegram → Viber ޕްރައިޓަރީ އަށް.
ހެޑަރސް
Content-Type: application/json
X-Authorization-Key: <organization key from omni.smsbat.com>
X-Viber-Auth-Token: <viber bot token> # when the message goes through a Viber bot
X-Tg-Bot-Key: <telegram bot token> # when the message goes through a Telegram bot
އޮރގަނިޒޭޝަން ކީ omni.smsbat.com ގައި އެންމެ ފަށަންވާނެ؛ އެންމެ /bat/messagelist ގެ އެންމެ ކީ އެންވެސް ކީން އަށް. Bot tokens ބޮޓް އަށް އިނޑެންޓިފައިވާނެ: އޮރގަނިޒޭޝަން އެންވެސް އެންވެސް އަށް ވެސް token އަށް bot ފިލާވަންވާނެ.
ރިކުއެސްޓް ބޮޑީ
ބޮޑީ އެންމެ JSON array ގެ މެސެޖް އޮބޖެކްޓުން އަށް.
މެސެޖް އޮބޖެކްޓު
| Field | Type | Description |
|---|---|---|
id | string | އަށް ފަށަންވާނެ ޓްރެކިންގް އިޑެންޓިފަޏަން. އެންމެ trackinId ގެ ލަންސަވާނެ ލަންސަވާނެ އަށް track_id ގެ ލަންސަވާނެ callbacks ގެ. |
callbackUrl | string | މި މެސެޖް ގެ ފިލާވަންވާ ސްޓެޓިސް އަށް ފަށަންވާ HTTPS URL. ސްކުއެރީ ސްޓްރިންގް އަށް ވަނަށްވެސް އެވެ. |
fromName | string | Viber Business / SMS ގެ ފިލާވަންވާ ސެންޑަރ ނަމަ (alpha name). |
toPhone | string | ލަންސަވާނެ ފޮން: އިންޓަރނޭޝަނަލް ފޮރމެޓް، ޑިޖިޓްސް އަށްވާނެ، + ނެތް (380501234567). އޮޕްޝަނަލް: އެންވެސް ނެތް މެސެޖް ފަށަންވާނެ ބޮޓް ފަށަންވާނެ އަށް Viber Business / SMS ނެތް އަށް ނޭން. |
messageType | string | transaction, promo, viber_survey, flashcall. އެންވެސް Message Types އަށް. |
ttl | integer | ސެކަންޑްގައި Time-to-live. އެންވެސް އެންވެސް ފަށަންވާނެ expired ސްޓެޓިސް. |
viberMessage | object | Viber ޕާރޓް އޮފް މެސެޖް، އިންންވަން. |
tgMessage | object | Telegram ޕާރޓް އޮފް މެސެޖް، އިންންވަން. |
emailMessage, pushMessage | object | Email އަށް push ޕާރޓްސް، Swagger ގެ އަށް. |
customerData | any | އަށް ފަށަންވާނެ ޕޭލޯޑް އަށް މެސެޖް ގެ އަށް. |
flashcallText, buttonText, buttonAction | string | Flash call text and a button for channels that support it. |
viberMessage
| Field | Type | Description |
|---|---|---|
receiver | string | Viber bot user id. Use it when the bot runs on your side and you store the ids yourself. |
type | string | text, picture, video, file, contact, location, sticker. |
sender.name, sender.avatar | string | Sender shown in the bot. |
text | string | Message text, up to 7000 characters. |
media, thumbnail, video, fileName, size, duration | Media attributes for the non-text types. | |
keyboard | object | Viber keyboard. |
trackingData | string | Viber tracking data. |
fallbackText | string | Text used by the fallback channels when they have no own text. |
fallbacks | array | Fallback channels in the order they are tried, see below. |
tgMessage
| Field | Type | Description |
|---|---|---|
chatId | integer (int64) | Telegram chat id of the recipient in your bot. |
text | string | Message text. |
photoUrl, photoBase64, videoUrl | string | Media. |
buttons | array of { "text", "action" } | Inline buttons. |
fallbacks[]
Each element describes the next channel to try. Fields set here override the message-level values for that channel.
| Field | Type | Description |
|---|---|---|
messageType | string | Channel/type of the fallback, for example sms. |
toPhone | string | Phone for this fallback (digits only, no +). May differ from the message toPhone. |
fromName | string | މި ފޮލްބެކް ގެ ސެންޑަރ ނަން އެންމެވެސް. |
ttl | integer | މި ފޮލްބެކް ގެ TTL ސެކަންޑްސްގައި. |
text | string | މި ފޮލްބެކް ގެ ލިޔެވިން. |
media, thumbnail, video, fileName, size, duration, contact, location, buttonText, buttonAction | ރިޗް ފޮލްބެކްތައްގެ އޮޕްޝަނަލް އެޓްރިބިއުޓުތައް. |
އެކްސޭމްޕަލް: Viber ބޮޓް އަށް SMS ފޮލްބެކް އަދި ކޮލްބެކް URL
curl --request POST \
--url https://restapi.smsbat.com/api/CascadeMessage/send_message_async \
--header 'Content-Type: application/json' \
--header 'X-Authorization-Key: 61192c5***' \
--header 'X-Viber-Auth-Token: 5646dd4***' \
--data '[
{
"callbackUrl": "https://example.com/smsbat/status?channel=viber-bot",
"id": "DEVELOPER-TEST-SDFLW122",
"fromName": "YourBrand",
"toPhone": "380509180617",
"messageType": "transaction",
"ttl": 60,
"viberMessage": {
"type": "text",
"sender": { "name": "YourBrand" },
"text": "That is the Viber text",
"fallbacks": [
{
"messageType": "sms",
"toPhone": "380509180617",
"fromName": "YourBrand",
"ttl": 60,
"text": "SMS text for YourBrand"
}
]
}
}
]'
އެކްސޭމްޕަލް: ބޮޓް އަށްވެސް، ނަންވަނީ ބޮޓް ID އަށް
toPhone ނެތް މެސެޖް ބޮޓްގެ އަށް ފަހުންވާނެ؛ viberMessage.receiver (Viber) އަށް އެންމެވެސް ނެތް tgMessage.chatId (Telegram) އަށް އެންމެވެސް.
[
{
"id": "ORDER-12345",
"callbackUrl": "https://example.com/smsbat/status?channel=telegram-bot",
"messageType": "transaction",
"ttl": 3600,
"tgMessage": {
"chatId": 123456789,
"text": "Your order #12345 has been shipped"
}
}
]
ރިސްޕޮންސް
200 OK — ބެޗް އެކްސެޕްޓްއެއް. އެއްވެސް މެސެޖްގެ އޮބޖެކްޓް އެއް އެނގާނެވެސް ލިސްޓްގައި.
[
{ "messageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "trackinId": "DEVELOPER-TEST-SDFLW122" }
]
| Field | Description |
|---|---|
messageId | SMSBAT މެސެޖް GUID. ކޮލްބެކްސްގައި message_id އަށް ވެސްލަން؛ GET /api/CascadeMessage/status_guid/{guid} އަށް އަލުންވާ. |
trackinId | އަހަރެއް id. ކޮލްބެކްސްގައި track_id އަށް ވެސްލޭނެވޭ; GET /api/CascadeMessage/status_id/{id} އަށް މަގުލޭ. |
400 Bad Request — ބެޗް އެންގާނެވެސް ނިސްވާނެ އަށް ނިސްވާނެ އަށް ނިސްވާނެ. އެންގާނެވެސް އަށް ނިސްވާނެ އަށް ނިސްވާނެ. އެންގާނެވެސް އަށް ނިސްވާނެ އަށް ނިސްވާނެ. Other codes: 401 (invalid key), 5xx (our side, retry later).
Delivery statuses
The response only confirms acceptance. Delivery, read, expiry and failure events are posted to the message callbackUrl (or to the organization-level URL when the message has none). Format and statuses: Delivery Callbacks. Polling: GET /api/CascadeMessage/status_guid/{guid} or GET /api/CascadeMessage/status_id/{id}.
Limits
- Request body up to 10 MB. There is no validation of the number of elements in the array; the body size is the only limit.
- No per-second or per-minute request limits for the Cascade API. Batch messages instead of sending one request per message.
Best practices
- Use a unique
idper message and keep it under 255 characters; it is the key you will correlate callbacks with. - އެންމެ މެސެޖްގައި އެވެ
callbackUrlއަށް އެވެސް ފަށަންވާނީ އަށްވާ ފަށަން ނިމުންވާ ގެންނޭނެވެ އަށް އިންސްޓްރިންސް ފެންނަވަނީ ލިޔެވިފައިވާ. - އަލުންވާ ގަނޑުލަށް TTL އެންގާނެވޭ: ކޯޑްސްގައި މިނިޓްސް, ޓްރާނސެކްޝަނަލް މެސެޖްސްގައި ގައިވާ ސައިންސް, ޕްރޮމޯޝަންސްގައި ދަންވަނީ ޑޭސް.
- އަލުން ފަށަން އެންގާނެވޭ އަލަންވާ ފަށަން ފަށަން ވަނީ އަލުން ފަށަން އެންގާނެވޭ އިން ސްމަސް އެންގާނެވޭ ލަސްވަން ފަށަނީ.