Messages

Send Viber message

Changed on

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

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.

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’.

transactionalboolean

Whether the message is transactional. Defaults to false.

templateIdstring

Provider template ID for a transactional Viber message.

subscriptionsKeysstring[]

Example request

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

Response

Changes

    • warning

      removed the request property

    • info

      added the new optional request property

    • info

      added the new optional request property