Get online users
Gets the status of a user or multiple users by ID
- Parameters
- Advanced call ?
Function GetOnlineUsers(Val Token, Val UserIDs) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Viber Token |
| UserIDs | --users | String, Number, Array of String, Number | ✔ | Viber User(s) ID |
Returns
Map Of KeyAndValue - serialized JSON response from Viber
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
Token = "523b58ba82afffaa-7ef3b426...";
UserID = "tMNGhftyUPrB3r1lD+bT4g==";
Result = OPI_Viber.GetOnlineUsers(Token, UserID);
- Bash
- CMD/Bat
oint viber GetOnlineUsers \
--token "***" \
--users "tMNGhftyUPrB3r1lD+bT4g=="
oint viber GetOnlineUsers ^
--token "***" ^
--users "tMNGhftyUPrB3r1lD+bT4g=="
Result
{
"status": 0,
"status_message": "ok",
"users": [
{
"id": "tMNGhftyUPrB3r1lD+bT4g==",
"online_status": 4,
"online_status_message": "unavailable",
"last_online": 0
}
]
}