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

FieldValue
Endpoint URLhttps://apis.rmlconnect.net/vbm-single/api/v2/send
MethodPOST
Content-Typeapplication/json
Authentication RequiredYes

Request headers

HeaderValueDescription
Content-Typeapplication/jsonSpecifies the media type of the request body.
AuthorizationBearer <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

FieldTypeRequiredDescription
message_typestringYesType of message. Use text for plain text messages. Supports up to 2500 characters.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
textstringYesPlain text message content to send.
ttlstringYesTime 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use image for rich image messages.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
imgstringYesImage 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use text_image.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
imgstringYesImage or media URL.
textstringYesPlain 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use media.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
button_textstringYesText shown on the CTA button.
textstringYesPlain text message content to send.
button_linkstringYesLink 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use template.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
button_textstringYesText shown on the CTA button.
textstringYesPlain text message content to send.
button_linkstringYesLink URL.
imgstringYesImage or media URL.
tracking_datastringYesTracking 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use file for document messages.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
file_urlstringYesFile URL.
file_namestringYesFile name.
tracking_datastringYesTracking 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use video.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
videostringYesMP4 video URL.
thumbnail_urlstringYesPNG thumbnail image URL.
tracking_datastringYesTracking 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use text_video.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
videostringYesMP4 video URL.
thumbnail_urlstringYesPNG thumbnail image URL.
textstringYesPlain text message content.
tracking_datastringYesTracking 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use verify_otp.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesUse verify.
templateobjectYesTemplate details.
template_idstringYesTemplate ID.
template_paramsobjectYesTemplate parameter values.
pinstringYesOTP PIN.
business_platform_namestringYesBusiness platform name.
template_langstringYesTemplate 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use text_template.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
textstringYesPlain text message.
pinstringYesPIN value.
tracking_datastringYesTracking 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use video_action.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
textstringYesPlain text message.
videostringYesVideo URL.
thumbnail_urlstringYesPNG image URL.
button_textstringYesText 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

FieldTypeRequiredDescription
message_typestringYesType of message. Use video_text_action_button.
phonestringYesRecipient's phone number in international format, for example 91XXXXXXXXXX.
methodstringYesType of message: Promotional or Transactional.
textstringYesPlain text message.
videostringYesVideo URL.
thumbnail_urlstringYesPNG image URL.
buttonobjectYesButton details.
button_urlstringYesURL opened when the user clicks the button.
button_textstringYesText 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 StatusDescriptionExample
400 Bad RequestInvalid request format or missing fields.{"status": "error", "description": "Missing phone number"}
401 UnauthorizedInvalid or missing authentication token.{"status": "error", "description": "Authentication failed"}
403 ForbiddenAccess denied or token expired.{"status": "error", "description": "Token expired"}
500 Internal Server ErrorSomething 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"
}


Did this page help you?