Send Viber message with image and button
Example of request to send a Viber message with image and button which, when clicked, will lead to the specified link.
URI: /api/xml.php
All requests to API are sent in XML format using the POST method.
Request parameters
Request example
<?xml version="1.0" encoding="utf-8" ?>
<package key="bb56a4369eb19***cfec6d1776bd25">
<message-viber>
<msg id="1234">
<phone>+380971234567</phone>
<sender>SMSTest</sender>
<type>image</type>
<text>Message text to be sent via Viber</text>
<button>Caption</button>
<url>https://page.url</url>
<image>https://image.url/image.png</image>
</msg>
</message-viber>
</package>
Response parameters
packagetag Tag to transmit the credentials required for authorization
|
Response examples
- Successful
- Wrong message ID
HTTP Status Code: 200
Content Type: JSON application/json
<?xml version="1.0" encoding="utf-8" ?>
<package>
<message-viber>
<msg id="1234" msg_id="1234568">1</msg>
</message-viber>
</package>
HTTP Status Code: 200
Content Type: JSON application/json
<?xml version="1.0" encoding="utf-8" ?>
<package>
<message-viber>
<msg id="7777" msg_id="0">201</msg>
</message-viber>
</package>