Send Viber message with text
Example of request to send Viber message with text to the specified number.
URI: /api/json.php
All requests to API are sent in JSON format using the POST method.
Header parameters
Requests must contain header Content-Type: application/json, otherwise, the request will be considered invalid even if it has valid JSON.
Request parameters
Request example
{
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "viber",
"id": 100500,
"phone": 380971234567,
"viber_type": "text",
"viber_signature": "ViberTest",
"viber_message": "Message text to send via Viber",
"viber_lifetime": 172800,
"short_link": true,
"hook": "https://example.org/webhook/url.php"
}
]
}
Response parameters
successinteger Result of request execution | |||||||
errorstring Error text, returned if success=false | |||||||
datalist[object] List of objects with the results of request execution
|
Response examples
- Successful
- Access denied
- Error in Alpha-name
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": true,
"data": [
{
"success": true,
"data": {
"id": 100500,
"msg_id": 123456789,
"data": 1,
"parts": 1
}
}
]
}
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": false,
"error": "Access denied"
}
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": true,
"data": [
{
"success": false,
"error": "Error in Alpha-name",
"data": {
"id": 100500
}
}
]
}