/api/v1/sendBulkViber
Send message(s) to multiple lists as well as personalised messages in batch mode
'delivery_list': [ '375291111111', '375292222222', ]
If you need to send each message to a different phone number, then use ‘message_type’: ‘personal’, passing the message text and phone number each time. For example:
'delivery_list': [
{
'phone': '375291111111',
'text': 'personal message 1'
},
{
'phone': '375292222222',
'text': 'personal message 2'
}
]To schedule a mailing, you can specify the time of the mailing via the schedule_time parameter, in the format YYYY-MM-DDTHH:mm:ssThe peculiarity of sending a Viber message is the availability of three options: text, image or button.
The filling options are given in the sample api request.
Attention!
The image option can only be used in a mailing with message_type = bulk.
In the button variant, the button_link parameter must not exceed 150 characters.
The image_url parameter in the button and image variants must have a link to an image that is publicly available.
Sample api request
{
"token": "eyJpdiI6IjJzOFlFcXBmOUZEcGJlYzlzeFJValE9PSIsInZhbHV",
"callback_url": "http://example-site.com/webhook.php",
"messages": [
{
"alphaname_id": "444",
"name": "mailing list 1",
"message_type": "personal",
"schedule_time": "2024-10-30T22:56:00",
"content": {
"type": "button",
"image_url": "https://example-site.com/images/image.jpg",
"caption": "Push me"
},
"delivery_list": [
{
"phone": "375291111111",
"text": "personal message 1.1",
"button_link": "https://example-site.com/some_action/1"
},
{
"phone": "375292222222",
"text": "personal message 1.2",
"button_link": "https://example-site.com/some_action/2"
}
]
},
{
"alphaname_id": "444",
"name": "mailing list 2",
"message_type": "personal",
"schedule_time": "2024-10-30T22:56:00",
"content": {
"type": "text"
},
"delivery_list": [
{
"phone": "375291111111",
"text": "personal message 2.1"
},
{
"phone": "375292222222",
"text": "personal message 2.2"
}
]
},
{
"alphaname_id": "444",
"name": "mailing list 3",
"message_type": "bulk",
"schedule_time": "2024-10-30T22:56:00",
"content": {
"type": "button",
"image_url": "https://example-site.com/images/image.jpg",
"button_link": "https://example-site.com/some_action",
"caption": "Button",
"text": "message text 3"
},
"delivery_list": [
"375291111111",
"375292222222"
]
},
{
"alphaname_id": "444",
"name": "mailing list 4",
"message_type": "bulk",
"schedule_time": "2024-10-30T22:56:00",
"content": {
"type": "text",
"text": "message text 4"
},
"delivery_list": [
"375291111111",
"375292222222"
]
},
{
"alphaname_id": "444",
"name": "mailing list 5",
"message_type": "bulk",
"schedule_time": "2024-10-30T22:56:00",
"content": {
"type": "image",
"image_url": "https://example-site.com/images/image.jpg"
},
"delivery_list": [
"375291111111",
"375292222222"
]
}
]
}Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| token | query | string | Yes | Your API key |
| callback_url | query | string | No | URL to which (if the parameter is set) the response on the method operation in asynchronous mode will be sent |
| messages | query | array | Yes | Message array (Sample object in the request description) |
Responses
200 — Completed successfully
{
"uuid": "cc9c8043-8caf-11ef-b035-9e8f47954dec",
"success": "OK"
}
