Help Center Cascade ލިޔުންސް ފޮނުވޭނެ

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 ގެ މެސެޖް އޮބޖެކްޓުން އަށް.

މެސެޖް އޮބޖެކްޓު

FieldTypeDescription
idstringއަށް ފަށަންވާނެ ޓްރެކިންގް އިޑެންޓިފަޏަން. އެންމެ trackinId ގެ ލަންސަވާނެ ލަންސަވާނެ އަށް track_id ގެ ލަންސަވާނެ callbacks ގެ.
callbackUrlstringމި މެސެޖް ގެ ފިލާވަންވާ ސްޓެޓިސް އަށް ފަށަންވާ HTTPS URL. ސްކުއެރީ ސްޓްރިންގް އަށް ވަނަށްވެސް އެވެ.
fromNamestringViber Business / SMS ގެ ފިލާވަންވާ ސެންޑަރ ނަމަ (alpha name).
toPhonestringލަންސަވާނެ ފޮން: އިންޓަރނޭޝަނަލް ފޮރމެޓް، ޑިޖިޓްސް އަށްވާނެ، + ނެތް (380501234567). އޮޕްޝަނަލް: އެންވެސް ނެތް މެސެޖް ފަށަންވާނެ ބޮޓް ފަށަންވާނެ އަށް Viber Business / SMS ނެތް އަށް ނޭން.
messageTypestringtransaction, promo, viber_survey, flashcall. އެންވެސް Message Types އަށް.
ttlintegerސެކަންޑްގައި Time-to-live. އެންވެސް އެންވެސް ފަށަންވާނެ expired ސްޓެޓިސް.
viberMessageobjectViber ޕާރޓް އޮފް މެސެޖް، އިންންވަން.
tgMessageobjectTelegram ޕާރޓް އޮފް މެސެޖް، އިންންވަން.
emailMessage, pushMessageobjectEmail އަށް push ޕާރޓްސް، Swagger ގެ އަށް.
customerDataanyއަށް ފަށަންވާނެ ޕޭލޯޑް އަށް މެސެޖް ގެ އަށް.
flashcallText, buttonText, buttonActionstringFlash call text and a button for channels that support it.

viberMessage

FieldTypeDescription
receiverstringViber bot user id. Use it when the bot runs on your side and you store the ids yourself.
typestringtext, picture, video, file, contact, location, sticker.
sender.name, sender.avatarstringSender shown in the bot.
textstringMessage text, up to 7000 characters.
media, thumbnail, video, fileName, size, durationMedia attributes for the non-text types.
keyboardobjectViber keyboard.
trackingDatastringViber tracking data.
fallbackTextstringText used by the fallback channels when they have no own text.
fallbacksarrayFallback channels in the order they are tried, see below.

tgMessage

FieldTypeDescription
chatIdinteger (int64)Telegram chat id of the recipient in your bot.
textstringMessage text.
photoUrl, photoBase64, videoUrlstringMedia.
buttonsarray 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.

FieldTypeDescription
messageTypestringChannel/type of the fallback, for example sms.
toPhonestringPhone for this fallback (digits only, no +). May differ from the message toPhone.
fromNamestringމި ފޮލްބެކް ގެ ސެންޑަރ ނަން އެންމެވެސް.
ttlintegerމި ފޮލްބެކް ގެ TTL ސެކަންޑްސްގައި.
textstringމި ފޮލްބެކް ގެ ލިޔެވިން.
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" }
]
FieldDescription
messageIdSMSBAT މެސެޖް 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 id per message and keep it under 255 characters; it is the key you will correlate callbacks with.
  • އެންމެ މެސެޖްގައި އެވެ callbackUrl އަށް އެވެސް ފަށަންވާނީ އަށްވާ ފަށަން ނިމުންވާ ގެންނޭނެވެ އަށް އިންސްޓްރިންސް ފެންނަވަނީ ލިޔެވިފައިވާ.
  • އަލުންވާ ގަނޑުލަށް TTL އެންގާނެވޭ: ކޯޑްސްގައި މިނިޓްސް, ޓްރާނސެކްޝަނަލް މެސެޖްސްގައި ގައިވާ ސައިންސް, ޕްރޮމޯޝަންސްގައި ދަންވަނީ ޑޭސް.
  • އަލުން ފަށަން އެންގާނެވޭ އަލަންވާ ފަށަން ފަށަން ވަނީ އަލުން ފަށަން އެންގާނެވޭ އިން ސްމަސް އެންގާނެވޭ ލަސްވަން ފަށަނީ.