Skip to main content

Subscribers Status

POST https://chatapi.viber.com/pa/get_online

This endpoint allows you to retrieve the online status of your subscribers.
You can retrieve the online status of up to 100 subscribers in a single request.

Request

Headers


Content-Type: application/json
Authorization: X-Viber-Auth-Token: YOUR_AUTHENTICATION_TOKEN

Parameters


NameTypeDescriptionNotes
idsarray of stringsThe list of subscribers ids.Max 100 ids
Example
curl -X POST https://chatapi.viber.com/pa/get_online -H "X-Viber-Auth-Token: YOUR_AUTHENTICATION_TOKEN" -d '{"ids":["jc9HsWTZ2Yf2NkRZ8KcNug==","fd4HsWT33Yf1BkRZ8KcBsk=="]}'

Response

Attributes


NameTypeDescriptionNotes
statusintegerThe status of the request.0 for success. In case of error, an error code will be returned. See common errors for more information
status_messagestringThe status message of the request.ok for sucess. In case of error, one of the following errors will be returned: invalidUrl, invalidAuthToken, badData, missingData and failure. See common errors for more information
usersarray of objectsThe list of subscribers with their online status.
users.idstringThe id of the subscriber.
user.online_statusintegerThe online status of the subscriber.0 - online, 1 - offline, 2 - undisclosed, the user set Viber to hide the status, 3 - try later, in case of internal error, 4 - unavailable, the user is not a Viber user or is not a subscriber of the bot or is unregistered from the app
user.online_status_messagestringThe online status message of the subscriber. on of online, offline, undisclosed, tryLater and unavailable

Headers


Content-Type: application/json

Body

{
"status":0,
"status_message":"ok",
"users":[
{
"id":"jc9HsWTZ2Yf2NkRZ8KcNug==",
"online_status":0,
"online_status_message":"online"
},
{
"id":"fd4HsWT33Yf1BkRZ8KcBsk==",
"online_status":1,
"online_status_message":"offline"
}
]
}