Viber Single Message API
The Viber Single Message API allows you to send enhanced messages to users through a Viber-enabled bot.
Single message endpoint details
| Field | Value |
|---|---|
| Endpoint URL | https://apis.rmlconnect.net/vbm-single/api/v2/send |
| Method | POST |
| Content-Type | application/json |
| Authentication Required | Yes |
Request headers
| Header | Value | Description |
|---|---|---|
| Content-Type | application/json | Specifies the media type of the request body. |
| Authorization | Bearer <your-auth-token> | Replace with your valid token from the login API. |
Send Plain Text Message
Send a plain text message to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use text for plain text messages. Supports up to 2500 characters. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| text | string | Yes | Plain text message content to send. |
| ttl | string | Yes | Time to live. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "text",
"method": "transaction",
"text": "Testing with v",
"tracking_data": "Sparta",
"ttl": 20
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Send Image
Send an image message to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use image for rich image messages. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| img | string | Yes | Image or media URL. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "image",
"method": "promotion",
"img": "https://d3om6746ch1nzl.cloudfront.net/RMLTestVBM_03287b07748a6d2a3fbd31d211ac89e588fa7e888e1e17fbffab84b81dcd79d1.png"
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Send Text + Image
Send a text and image message to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use text_image. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| img | string | Yes | Image or media URL. |
| text | string | Yes | Plain text message content to send. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "text_image",
"method": "promotion",
"img": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_03287b07748a6d2a3fbd31d211ac89e588fa7e888e1e17fbffab84b81dcd79d1.png",
"text": "hi",
"tracking_data": "gaurav"
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Text + Button Message
Send a text message with a CTA button to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use media. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| button_text | string | Yes | Text shown on the CTA button. |
| text | string | Yes | Plain text message content to send. |
| button_link | string | Yes | Link URL. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "media",
"method": "promotion",
"text": "test",
"button_text": "click me ",
"button_link": "https://www.google.com/search?client=firefox-b-d&q=test&sei=SC2OZ8jmMJqMseMPuOOKYQ"
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Text + Button + Image Message
Send a text, button, and image message to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use template. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| button_text | string | Yes | Text shown on the CTA button. |
| text | string | Yes | Plain text message content to send. |
| button_link | string | Yes | Link URL. |
| img | string | Yes | Image or media URL. |
| tracking_data | string | Yes | Tracking data for the request. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "template",
"method": "promotion",
"text": "test",
"button_text": "test",
"button_link": "https://www.routemobile.com/",
"img": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_9dc30e900d843592a4d78d6870cf9bd6e78c9a409a50311453af33dee9c6ca25.png",
"tracking_data": "test_tracking-1233"
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Send Document
Send a document to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use file for document messages. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| file_url | string | Yes | File URL. |
| file_name | string | Yes | File name. |
| tracking_data | string | Yes | Tracking data for the request. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "file",
"method": "transaction",
"file_url": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_e90b6e6e1e584bc3930b77b9d8eaf5541290110539c24366e27319411287ea98.pdf",
"file_name": "test file",
"tracking_data": "test-track-1"
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Send Video
Send a video message to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use video. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| video | string | Yes | MP4 video URL. |
| thumbnail_url | string | Yes | PNG thumbnail image URL. |
| tracking_data | string | Yes | Tracking data for the request. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "video",
"method": "promotion",
"video": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_05bd857af7f70bf51b6aac1144046973bf3325c9101a554bc27dc9607dbbd8f5.mp4",
"thumbnail_url": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_03287b07748a6d2a3fbd31d211ac89e588fa7e888e1e17fbffab84b81dcd79d1.png",
"tracking_data": "demo_tracking_data"
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Send Text + Video
Send a text and video message to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use text_video. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| video | string | Yes | MP4 video URL. |
| thumbnail_url | string | Yes | PNG thumbnail image URL. |
| text | string | Yes | Plain text message content. |
| tracking_data | string | Yes | Tracking data for the request. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "text_video",
"method": "promotion",
"video": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_05bd857af7f70bf51b6aac1144046973bf3325c9101a554bc27dc9607dbbd8f5.mp4",
"text": "hi",
"thumbnail_url": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_9dc30e900d843592a4d78d6870cf9bd6e78c9a409a50311453af33dee9c6ca25.png",
"tracking_data": "test-track"
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Send Verification Message (OTP) via Template
Send an OTP verification message to a user through a Viber template.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use verify_otp. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Use verify. |
| template | object | Yes | Template details. |
| template_id | string | Yes | Template ID. |
| template_params | object | Yes | Template parameter values. |
| pin | string | Yes | OTP PIN. |
| business_platform_name | string | Yes | Business platform name. |
| template_lang | string | Yes | Template language. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "verify_otp",
"method": "verify",
"template": {
"template_id": "c33cccaf-735f-4d62-8383-a76bf4999e2d",
"template_params": {
"pin": "72739",
"business_platform_name": "Route Mobile"
},
"template_lang": "en"
}
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Send Transactional Template Message
Send a transactional text template message to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use text_template. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| text | string | Yes | Plain text message. |
| pin | string | Yes | PIN value. |
| tracking_data | string | Yes | Tracking data for the request. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "text_template",
"method": "transaction",
"text": "test",
"tracking_data": "test"
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Send Video + Button + Text
Send a video message with text and a button label to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use video_action. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| text | string | Yes | Plain text message. |
| video | string | Yes | Video URL. |
| thumbnail_url | string | Yes | PNG image URL. |
| button_text | string | Yes | Text displayed on the button. |
Request body
{
"phone": "919769187972",
"message_type": "video_action",
"method": "promotion",
"video": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_05bd857af7f70bf51b6aac1144046973bf3325c9101a554bc27dc9607dbbd8f5.mp4",
"text": "hi",
"thumbnail_url": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_9dc30e900d843592a4d78d6870cf9bd6e78c9a409a50311453af33dee9c6ca25.png",
"button_text": "test"
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Send Video + Button (URL) + Text
Send a video message with text and a URL button to a user through Viber.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| message_type | string | Yes | Type of message. Use video_text_action_button. |
| phone | string | Yes | Recipient's phone number in international format, for example 91XXXXXXXXXX. |
| method | string | Yes | Type of message: Promotional or Transactional. |
| text | string | Yes | Plain text message. |
| video | string | Yes | Video URL. |
| thumbnail_url | string | Yes | PNG image URL. |
| button | object | Yes | Button details. |
| button_url | string | Yes | URL opened when the user clicks the button. |
| button_text | string | Yes | Text displayed on the button. |
Request body
{
"phone": "{{MOBILE_NUMBER}}",
"message_type": "video_text_action_button",
"method": "promotion",
"video": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_05bd857af7f70bf51b6aac1144046973bf3325c9101a554bc27dc9607dbbd8f5.mp4",
"text": "hi",
"thumbnail_url": "https://nextgen-vbm.s3.ap-south-1.amazonaws.com/demo_9dc30e900d843592a4d78d6870cf9bd6e78c9a409a50311453af33dee9c6ca25.png",
"button": {
"button_url": "http://www.google.com",
"button_text": "Click Me"
}
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "432f0188-0746-11f1-bb0e-0242ac110002"
}Common error responses
| HTTP Status | Description | Example |
|---|---|---|
| 400 Bad Request | Invalid request format or missing fields. | {"status": "error", "description": "Missing phone number"} |
| 401 Unauthorized | Invalid or missing authentication token. | {"status": "error", "description": "Authentication failed"} |
| 403 Forbidden | Access denied or token expired. | {"status": "error", "description": "Token expired"} |
| 500 Internal Server Error | Something went wrong on the server. | {"status": "error", "description": "Internal server error"} |
Fallback Channels — Single Message API
Use fallback channels to route a Viber single message through another channel when fallback is required.
Fallback to SMS (Single)
{
"phone": "918928878551",
"message_type": "text",
"method": "transaction",
"text": "Testing with v",
"tracking_data": "Sparta",
"fallback_channel": "sms",
"fallback_sms": {
"fallback_sender": "ALOTSL",
"fallback_username": "AlotPromo",
"fallback_text": "We'\\''re providing WhatsApp Marketing Solutions is the easy marketing strategy for your business Call 8080888131 alotsolutions.com",
"template_id": "507167343822070952",
"tm_id": "1702160915855670817",
"pe_id": "1201159179954058607"
}
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "11e8b3ee-33e7-11f1-ba44-0242ac110002"
}Fallback to WhatsApp (Single)
{
"phone": "918928878551",
"message_type": "text",
"method": "transaction",
"text": "Testing with v",
"tracking_data": "Sparta",
"fallback_channel": "whatsapp",
"fallback_whatsapp": {
"fallback_sender": "ALOTSL",
"fallback_username": "AlotPromo",
"fallback_text": "We'\\''re providing WhatsApp Marketing Solutions is the easy marketing strategy for your business Call 8080888131 alotsolutions.com",
"template_id": "507167343822070952",
"tm_id": "1702160915855670817",
"pe_id": "1201159179954058607"
}
}Response
{
"status": "success",
"message": "Api execution is successful",
"request_id": "08f56092-33e8-11f1-ba44-0242ac110002"
}Updated 11 days ago