Send message via Viber

This endpoint is used to send Viber messages by individually or with bulk requests.

It is ideal to send the personalized messages for use-cases like notifications, alerting or marketing for example.

Hình mẫu tin nhắn Viber

HTTP request

POST https://rest.esms.vn/MainService.svc/json/Send_Multiple_Sms_OTT/

  • Content Type: application/json

  • Response Type: application/json

curl --location 'https://rest.esms.vn/MainService.svc/json/Send_Multiple_Sms_OTT/' \
--header 'Content-Type: application/json' \
--data '{
    "ApiKey": "{{ApiKey}}",
    "SecretKey": "{{SecretKey}}",
    "Brandname": "{{Brandname}}",
    "SmsType": "23",
    "Content": "{{Content}}",
    "OttImgUrl": "{{OttImgUrl}}",
    "OttLabel": "{{OttLabel}}",
    "OttUrl": "{{OttUrl}}",
    "Phones": [
        "{{Phone1}}","{{Phone2}}","{{Phone3}}"
    ],
    "IsSandBox": "{{IsSandBox}}",
    "CallbackUrl": "{{CallbackUrl}}"
}'
  • Request body

Parameter
Type
Required
Description

ApiKey

string

Your API Key.

SecretKey

string

Your Secret Key.

Brandname

string

The name of the sender is shown in the header of the customer's message. Pre-registration is required.

SmsType

number

Message type: 23: OTT message via Viber.

Content

string

The personized or marketing content.

OttImgUrl

string

The URL of image. The schema has to be https.

OTTLabel

string

The label of button.

OttUrl

string

The redirect URL when clicking to the button.

Phones

Array

The list phone number of receivers.

IsSandBox

number

Sandbox option value (default is 0): 1: For testing purpose to verify the validation of the request. Message is not charged and sent to the receiver. 0: Message will be processed to the receiver properly.

CallbackUrl

string

The webhook URL that will receive the status of message after it processed to the operator. It is used for determine whether the SMS is succcessfully delivered to the receiver or failed. See the sample request at here. More details at here.

  • Note: Sending the message via Viber, there are 4 sending options can be used:

Content Type
Params required

Text - Image - Button

Content OttImgUrl OttUrl OTTLabel

Text - Button

Content OttUrl OTTLabel

Image

OttImgUrl

Text

Content


  • Response:

{
    "CodeResult": "100",
    "CountRegenerate": 0,
    "SMSID": "d8e0f1f0702544b2acb456ca9ccfd111250"
}

Valid request.

  • Response body

Parameter
Type
Description

CodeResult

string

Response code.

SMSID

string

The message id eSMS system.

ErrorMessage

string

The error message if the request is invalid.

Last updated