SMSBAT Cascade RESTful API
Overview
SMSBAT Cascade RESTful API allows sending messages via Viber and SMS, supporting two message types: transactional and promo.
How It Works?
Using SMSBAT Cascade RESTful API is simple and straightforward:
- Send a Single Request: Initiate a message by sending a single API request.
- Automatic Cascading: Our API automatically cascades messages to Telegram Bot, Viber Bot, Viber Business Messages, RCS, and SMS.
- Efficient Delivery: Messages are efficiently delivered to recipients on all selected platforms.
Protocol
HTTPS is used as the protocol. The request body is a JSON array of message objects.
Authentication
For your convenience, several authentication options are available:
curl -H "X-Authorization-Key:<SMSBAT-API-Key>" -H "X-Viber-Auth-Token:<Viber-Bot-API-Key>" -H "X-Tg-Bot-Key:<Telegram-Bot-API-Key>" -H "Content-Type:application/json"
Endpoints
Requests to the SMSBAT Cascade RESTful API are sent to the endpoint with localization
Message Types
The API supports different message types for different use cases
Transactional Messages
Used for important notifications, such as transaction confirmations, security alerts, etc.
{
"id": "12358",
"fromName": "AlphaName",
"toPhone": "380680000000",
"messageType": "transaction",
"ttl": 60,
"sheduledSent": "2023-12-04T16:18:00.000+02:00",
"wheterCheckSession": true,
"viberMessage": {
"receiver": "9SM4pcbqBp8bFgbZtgmqBA==",
"minApiVersion": 1,
"type": "text",
"sender": {
"name": "John McClane",
"avatar": "http://avatar.example.com"
},
"text": "Hello World!!!",
"fallbackText": "Test text"
},
"tgMessage": {
"text": "Hello world!!!",
"photoUrl": "https://example.com/image.jpg",
"chatId": 544507441,
"buttons": [
{
"action": "action",
"text": "Press"
}
]
}
}Promo Messages
Used for marketing campaigns, advertisements, and informational messages.
{
"id": "12358",
"fromName": "AlphaName",
"toPhone": "380680000000",
"messageType": "promo",
"sheduledSent": "2023-12-04T16:18:00.000+02:00",
"buttonText": "test",
"buttonAction": "https://www.google.com/",
"wheterCheckSession": true,
"viberMessage": {
"receiver": "9SM4pcbqBp8bFgbZtgmqBA==",
"minApiVersion": 1,
"type": "picture",
"sender": {
"name": "John McClane",
"avatar": "http://avatar.example.com"
},
"text": "Моя промоція, моє ім'я %name=1% моя тестова URL-адреса %url=1%",
"media": "http://www.images.com/promo.jpg",
"keyboard": {
"type": "keyboard",
"defaultHeight": true,
"buttons": [{
"actionType": "reply",
"actionBody": "відповісти мені",
"text": "Детальніше",
"textSize": "regular"
}]
},
"fallbackText": "Промо: Нова Промоція!"
}
}Viber Survey Messages

Interactive survey messages with multiple choice options for collecting feedback from users.
{
"id": "21111112",
"fromName": "AlphaName",
"toPhone": "380936670003",
"messageType": "viber_survey",
"ttl": 80,
"viberMessage": {
"ttl": 60,
"text": "Оцініть якість обслуговування в нашому магазині. Ваш відгук допоможе стати кращими 💛",
"survey": {
"options": [
"😍Все було супер!",
"🙂Добре, але є куди рости",
"😕Нормально",
"😞Погано",
"😡Жахливо"
]
}
},
"customerData": {
"type": "data"
}
}Flash Call
Automatic call to confirm the phone number.
{
"id": "15",
"toPhone": "380669227498",
"flashcallText": "343",
"fromName": "alphaname",
"messageType": "flashcall"
}Variables in Messages
To send messages with variable content, use the following syntax
Variable Syntax
To include a variable in a message, wrap the variable identifier with '%' and specify the variable type.
"text": "My Variable %name=id%"
Important!
Before sending a message with variable content, variables must be uploaded to https://api.counterbat.com/api/items
Viber Survey Message Builder
Створіть та відправте Viber Survey повідомлення з інтерактивним опитуванням
Response Example
After a successful message send, the API returns the following response
[
{
"messageId": "f5af2610-0e3e-42f5-888d-c65561deed14",
"trackinId": "12358"
}
]