Notification API - list.active.channels
This API action returns a list of active channels with currently connected users to whitch web notifications can be sent.
Each returned channel also has information about the number of currently open websockets (see the "clients" parameter in the response data).
API service and action
webntf | Websocket service called via API |
list.active.channels | Action called on remote API |
API request data
domain | Domain name for select active websocket channels |
Example request data
array(2) {
["domain"]=>
string(16) "www.websocket.cz"
}
Example PHP code for call websocket API
$responseData = $rest2WebSocket->call("webntf", "list.active.channels", [
"domain" => "www.websocket.cz"
]);
API response data
array(3) {
["status"]=>
string(2) "OK"
["time"]=>
float(1647533637.073608)
["result"]=>
array(2) {
[0]=>
array(3) {
["key"]=>
string(16) "www.websocket.cz"
["domain"]=>
string(16) "www.websocket.cz"
["clients"]=>
int(8)
}
[1]=>
array(3) {
["key"]=>
string(16) "kr7wy8m6ft5awr6634rwr7na4"
["domain"]=>
string(16) "www.websocket.cz"
["clients"]=>
int(5)
}
[3]=>
array(3) {
["key"]=>
string(16) "lin67wy6gmjfn7aw937v6nmeg"
["domain"]=>
string(16) "www.websocket.cz"
["clients"]=>
int(3)
}
}
}