Help Center TurboSMS API Compatibility

TurboSMS API Compatibility

SMSBAT fully supports a compatibility layer with the TurboSMS API. This allows you to migrate your existing integrations that were designed for TurboSMS directly to SMSBAT without having to rewrite the message structures or endpoint payloads.

We support sending SMS and Viber messages (including advanced features like carousels and surveys), fetching statuses, and fetching message details using the exact same request body structures you are already familiar with.

Authentication

The only difference from the native TurboSMS API is the Authentication mechanism. While TurboSMS uses a custom token query parameter or a specific auth header, SMSBAT requires a standard Bearer Token.

You must include your SMSBAT API Token in the Authorization header for all requests:

Authorization: Bearer YOUR_SMSBAT_TOKEN

Base URL

All endpoints should be directed to the SMSBAT API base URL:

https://restapi.smsbat.com

Send Single Message

Endpoint: POST /api/tsms/message/send

Allows sending SMS and Viber messages with support for hybrid delivery (Viber with SMS fallback). It processes a single send request and returns the delivery results for each recipient.

Key Capabilities

  • Flexible Parameters: Global parameters can be overridden by specific SMS/Viber parameters.
  • Content: Supports Viber carousels, surveys, file attachments, and interactive buttons.
  • Error Handling: Returns HTTP 200 even for errors (structured error responses). response_code: 999 with status FATAL_ERROR for system errors.
  • Recipient Errors: Specific recipient errors are returned in the response_result array. Failed recipients have message_id: null and specific error codes.

Request Example (Hybrid Message)

{
  "sender": "GlobalSender",
  "text": "Test message",
  "recipients": ["380951111111", "380952222222"],
  "start_time": "2025-09-29T10:00:00Z",
  "sequence_id": "seq_12345",
  "sms": {
    "sender": "SMSSender",
    "text": "SMS version of message",
    "is_flash": false
  },
  "viber": {
    "sender": "ViberSender",
    "text": "Viber version of message",
    "ttl": 3600,
    "image_url": "https://example.com/image.png",
    "caption": "Button text",
    "action": "https://google.com",
    "count_clicks": true,
    "is_transactional": false
  }
}
{
  "sender": "GlobalSender",
  "text": "Check out our products",
  "recipients": ["380951111111"],
  "viber": {
    "sender": "ViberSender",
    "text": "Check out our products",
    "is_transactional": false,
    "carousel": [
      {
        "title": "Product 1",
        "image_url": "https://example.com/product1.jpg",
        "button_caption": "Buy Now",
        "button_url": "https://example.com/buy/product1",
        "link_caption": "Learn More",
        "link_url": "https://example.com/product1"
      },
      {
        "title": "Product 2",
        "image_url": "https://example.com/product2.jpg",
        "button_caption": "Buy Now",
        "button_url": "https://example.com/buy/product2",
        "link_caption": "Learn More",
        "link_url": "https://example.com/product2"
      }
    ]
  }
}

Request Example (Viber Survey)

{
  "sender": "GlobalSender",
  "text": "Please rate our service",
  "recipients": ["380951111111"],
  "viber": {
    "sender": "ViberSender",
    "text": "Please rate our service",
    "is_transactional": true,
    "survey": [
      "Excellent",
      "Good",
      "Average",
      "Poor"
    ]
  }
}

Send Multiple Messages (Batch)

Endpoint: POST /api/tsms/message/sendmulti

This method allows you to send multiple send requests in a single HTTP request, saving connection overhead. Calling sendmulti with data for 100 requests will be faster than executing 100 individual send requests.

Request Example

{
  "batch_1": {
    "sender": "GlobalSender",
    "text": "Test message",
    "recipients": ["380982462128", "380501111111"],    
    "sms": {
        "sender": "SMSSender",
        "text": "SMS version of message"
    }
  },
  "batch_2": {
    "sender": "GlobalSender",
    "text": "Second message",
    "recipients": ["380501111111"],
    "viber": {
      "sender": "ViberSender",
      "text": "Viber message",
      "is_transactional": true
    }
  }
}

Response Example

{
    "response_code": 0,
    "response_status": "OK",
    "response_result": {
        "batch_1": {
            "response_code": 800,
            "response_status": "SUCCESS_MESSAGE_ACCEPTED",
            "response_result": [
                {
                    "phone": "380982462128",
                    "response_code": 0,
                    "message_id": "f1640579-ea75-4bc1-b708-1c3858bf222d",
                    "response_status": "OK"
                }
            ]
        },
        "batch_2": { ... }
    }
}

Get Message Status

Endpoint: POST /api/tsms/message/status

Retrieve the delivery statuses of sent messages by providing their message_id.

Request Example

{
  "messages": [
      "573dcb46-7851-4e16-bb1f-721c13ef5f38", 
      "6b7f9ff5-28c8-4f38-913b-31af6021fbea"
  ]
}

Get Message Details

Endpoint: POST /api/tsms/message/details

Allows you to retrieve detailed information about created messages, including full payload details for SMS and Viber channels, pricing, and exact timestamps.

Request Example

{
  "messages": [
      "573dcb46-7851-4e16-bb1f-721c13ef5f38", 
      "f1640579-ea75-4bc1-b708-1c3858bf222d"
  ]
}

Response Example

{
    "response_code": 0,
    "response_status": "OK",
    "response_result": [
        {
            "message_id": "573dcb46-7851-4e16-bb1f-721c13ef5f38",
            "sms": null,
            "viber": {
                "added": "2025-09-29T14:17:02.577Z",
                "start": "2025-09-29T10:00:00Z",
                "sent": "2025-09-29T14:17:02.577Z",
                "updated": "2025-09-29T14:17:02.577Z",
                "sender": "ViberSender",
                "text": "Viber version of message",
                "recipient": "380982462128",
                "message_type": "promotional",
                "status": "Queued",
                "price": 0,
                "ttl": 3600,
                "caption": "Button text",
                "action": "https://google.com"
            },
            "response_code": 0,
            "response_status": "OK"
        }
    ]
}