Help Center GMS API Compatibility

GMS API Compatibility

SMSBAT supports a compatibility layer with the GMS API. This allows you to migrate your existing integrations designed for GMS directly to SMSBAT without having to modify your message routing schemas, payload structures, or callback listeners.


Connection Settings

To route requests through SMSBAT, update the base URL and authentication credentials in your integration:

  • Base URL: https://restapi.smsbat.com
  • Endpoint: POST /api/GMSMessage/send_message
  • Request Format: application/json
  • Authentication: HTTP Basic Authentication (uses your SMSBAT API credentials)

Request Parameters

The GMS compatibility API accepts a JSON object with the following top-level parameters:

ParameterTypeRequiredDescription
phone_numberstringYesRecipient phone number in international format (e.g., 380501234567).
tagstringYesRegistered sender name / alpha name.
channelsarrayYesList of channels to try, in priority order. Supported values: viber, sms, push. E.g., ["viber", "sms"].
channel_optionsobjectYesMap containing options for each active channel (see below).
extra_idstringNoYour internal customer-side message ID.
callback_urlstringNoEndpoint URL on your system to receive delivery status callbacks.
division_codestringNoOptional division code identifier (defaults to main).

Channel Options Settings

The channel_options object contains channel-specific configurations.

Used when viber is listed in the channels array.

ParameterTypeRequiredDescription
textstringYesMessage body text.
ttlintegerYesTime-To-Live in seconds.
imgstringNoPublic HTTPS URL of the image to display.
captionstringNoButton text label.
actionstringNoDestination URL when button is clicked.
survey_optionsarrayNoArray of strings (2 to 5 items) to display as survey options.
carousel_itemsarrayNoArray of slide objects to display as a Viber carousel (see structure in tab).

Viber Request Example:

{
  "phone_number": "380501234567",
  "tag": "MySender",
  "channels": ["viber"],
  "channel_options": {
    "viber": {
      "text": "Hello from SMSBAT!",
      "ttl": 60,
      "img": "https://www.example.com/image.png",
      "caption": "Open",
      "action": "https://www.example.com"
    }
  }
}

Response Format

The endpoint returns responses in JSON format with an HTTP 200 OK status code.

Successful Response

{
  "MessageId": "6f0d5e28-7f3a-4df3-91a2-3d58d9e09b9a",
  "ErrorCode": null,
  "ErrorText": null
}

Error Responses

If validation or processing fails, an error response with a non-null ErrorCode and detailed ErrorText will be returned.

{
  "MessageId": "00000000-0000-0000-0000-000000000000",
  "ErrorCode": 10221,
  "ErrorText": "This type of Message is not supported by the system"
}

Callback Delivery Format

If callback_url was specified in the request, SMSBAT sends delivery status updates as a JSON POST payload to your endpoint.

Callback Request Example

POST /your-callback-endpoint HTTP/1.1
Host: yoursystem.com
Content-Type: application/json

{
  "number": "380501234567",
  "time": 1719237600000,
  "status": 2,
  "substatus": 23,
  "hyber_status": 23033,
  "message_id": "6f0d5e28-7f3a-4df3-91a2-3d58d9e09b9a",
  "extra_id": "ORDER-12345",
  "sent_via": "viber",
  "matching_template_id": 0
}

Callback Fields Description

FieldTypeDescription
numberstringRecipient phone number.
timenumberEvent timestamp in Unix milliseconds.
statusnumberSimplified status identifier (see Status code table).
substatusnumberDetailed status identifier (see Substatus code table).
hyber_statusnumberDetailed SMSBAT internal status code (see Hyber Status table).
message_idstringSMSBAT message ID (GUID) generated on sending.
extra_idstringCustomer-side ID provided in the original request.
sent_viastringChannel that processed the message: viber, sms, or rcs.
matching_template_idnumberViber template match status (where applicable).

Status Mappings

1. Simplified Status (status)

CodeMeaning
1Message accepted or being delivered.
2Message delivered.
3Processing or delivery error.

2. Detailed Status (substatus)

CodeMeaning
12Accepted for processing.
23Delivered.
24Seen/read.
35Not delivered within TTL (Expired).
36Delivery error.

3. Channel Type (sent_via)

ChannelDescription
viberStatus produced by Viber channel.
smsStatus produced by SMS channel.
rcsStatus produced by RCS channel.

4. Detailed SMSBAT Status (hyber_status)

CodeChannelStatusSubstatusMeaning
23033viber223Viber message delivered.
24013viber224Viber message read by recipient (Seen).
36013viber336Viber internal error.
36023viber336Invalid or unavailable Viber service ID.
36033viber336Invalid Viber payload data.
36037viber336Viber image URL too long.
36038viber336Invalid Viber image URL.
36039viber336Viber text too long.
36044viber336Empty Viber text.
36053viber336Unsupported Viber message type.
36063viber336Invalid Viber parameters.
36073viber336Viber provider timeout.
36083viber336Viber sender blocked by the recipient.
36093viber336Recipient is not registered as a Viber user.
36103viber336No Android/iOS device with Viber support found.
36113viber336Unauthorized IP address for Viber sending.
36123viber336Duplicate Viber message detected.
36143viber336Viber billing error.
36153viber336Message blocked by platform blacklist.
36163viber336Viber platform internal processing error.
36173viber336Wrong or missing Viber label.
36183viber336Invalid Viber TTL value.
12011sms / rcs112SMS/RCS accepted.
36011sms / rcs112SMS/RCS enroute.
23011sms / rcs223SMS/RCS delivered.
35015sms / rcs335SMS/RCS expired (not delivered within TTL).
36021sms / rcs336SMS/RCS message deleted.
36031sms / rcs336SMS/RCS cannot be delivered.
36041sms / rcs336Unknown SMS/RCS delivery status.
36051sms / rcs336SMS/RCS message rejected.