BSG utilizes HTTP cookies (and similar or complementary technologies) to 1) make this website safe, functional, and accessible (through the use of mandatory cookies) and 2) understand how you use our website (through the use of optional cookies) in order to improve your experience and to provide you with personalized content.

The information in the cookie text files may be related to your personal preferences or your device and is intended to make the site operate according to your expectations. The information contained in cookies does not usually identify your identity directly but is helpful in providing you with a more personalized user experience.

In accordance with the requirements of the General Data Protection Regulation (GDPR) privacy and security law that governs how the personal data of individuals in the EU may be processed and transferred, we provide you the possibility to prohibit the use of certain types of cookies when you use our website.

Read our Cookie Notice and the Privacy Policy for detailed information on how BGS collects and uses cookies. Please note that prohibiting the use of certain types of cookies may affect your interaction with the website and limit the accessibility of services we offer you. Choose the appropriate category below to learn more and to disable cookies.

Accept All cookies*
*Recommended for comfortable use of the site
Accept only necessary cookies
Accept only selected cookies
Necessary cookies
Social media
Analytics
Marketing
Developer Docs
Number Intelligence

The Viber API allows you to send messages to the Viber messenger, as well as to send SMS as an alternative if the message was not delivered to the messenger.

Send Viber message

The method allows you to make a Viber messaging. You can include an image, a title and a CTA button into your messages.
Also, this method allows you to specify the option of forwarding (cascading) a message via SMS with the indication of the SMS Alpha-name and its text.

To send Viber message, make a request to this URL:

PUT ( POST ) https://api.bsg.world/rest/viber/create

Request parameters:

Parameter Mandatory Type Description
validity No string Validity duration of the Viber message, in seconds (by default – 24 hours). An integer from 15 to 86400.
tariff No integer Tariff number. The default is 0. An integer from 0 to 9.
messages An array of message objects. Contains 1+ objects of the following structure:
to An array of recipients:
msisdn Yes string The phone number to which the message is sent.
reference No string Message external ID. A string of up to 32 characters containing /a-zA-Z0-9/.
text Yes string Viber message text.
alpha_name Yes string Sender. String of up to 14 characters.
is_promotional Yes boolean The indicator whether the message is promotional or transactional.
options Additional parameters for adding a picture, a title and a button.
img No string Image URL.
caption No string Button name.
action No string Button URL.
scheduledDatetime No string Time of sending the Viber message (for scheduling the campains).
alt_route No Additional parameters for forwarding a Viber message via SMS. These parameters are indicated only if it is necessary to provide alternative delivery of messages in case the message was not delivered in the messenger
originator Yes Sender
text Yes Message text

Request example:


{
    "tariff": 9,
    "validity": 24,
    "messages": [
        {
            "to": [
                {
                    "msisdn": "380972920283",
                    "external_id": "example_12"
                },
                {
                    "msisdn": "380972920282",
                    "external_id": "example_13"
                }
            ],
            "text": "My Viber messages are shinier than your SMS messages",
            "alpha_name": "My Company",
            "is_promotional": false,
            "options": {
                "viber": {
                    "img": "http://my-cool-webpage.com/logo.png",
                    "caption": "Join us!",
                    "action": "http://my-cool-webpage.com"
                    "alt_route": {
                       "originator": "testsms",
                       "text": "SMS message will be received if you are not a VIBER user."

                }
            },
            "scheduledDatetime": "ISO 8601 date"
        }
    ]
}

Response parameters:

Parameter Type Description
messages contains nested data:
id integer Message ID
reference string Viber message external ID
price float Message cost
currency string The currency of the account, in which the message cost in Viber campaign is specified

If request is successful, you will receive a response:


[
    {
        "error": "0",
        "messages": [
            {
                "id": "22125",
                "reference": "example_12",
                "price": "0.02",
                "currency": "EUR"
            },
            {
                "id": "22126",
                "price": "0.02",
                "currency": "EUR"
            }
        ]
    }
]

Interested in a special offer?

Ready to reach further?
Let’s talk

I agree to BSG privacy policy
Submit

Useful Materials

What Is Number Verifier — And Why It’s More Than Just an “HLR Lookup”

30% of SMS fail — not because of content, but numbers. Verify before you send.

10 Awesome Back-to-School Marketing Ideas 2025

The start of the school year: when parents trade in their summer margaritas for the

What Is CPaaS? Communications Platform as a Service

Talking to customers these days is more than just emails or phone calls. Businesses need