v1

latestOpenAPI 3.0.12026-07-24116117186.3 KB
Messages

Send Viber message

The method is used for sending a Viber message to a contact. A new contact is created if no contact with such phone number exists. Supports carousel messages with 2-5 items containing images and buttons.

post/api/v1/message/viber

Request body

textstring required

Message text

ttlSecondsinteger

Message lifetime in seconds, the default value is day.

imgstring
captionstring
actionstring

A clickable link embedded in a picture or in a button.

iosExpirityTextstring required

The notification a Viber user receives when a message is delivered after its lifetime expiration.

phoneNumbersstring[]

The list of the recipient phone numbers. <b>Required parameter</b><br>, if "groupId" is not specified.

tagsstring[]

The list of tags to be assigned to a message.

groupIdinteger

<b>Required parameter</b><br>. If "phoneNumbers" are not specified.

externalRequestIdstring

External request ID. It is the same for all the recipients.

fromstring

Sender's name. <b>Required parameter</b><br> if more than one sender is available.

trackUrlsboolean

The parameter determines whether to track links in a message or not. The default value is ‘true’.

subscriptionsKeysstring[]

Example request

{
  "text": "Subscribe to our channel",
  "ttlSeconds": 36000,
  "action": "https://example.com/",
  "iosExpirityText": "Message delivery success",
  "groupId": 2345678,
  "externalRequestId": "EXT-2023-ABC-12345",
  "from": "John Smith"
}