Use VNC Info API to get information about vnc of VPS on your server.
HTTP Request
https://hostname:4083/index.php?act=vnc&svs= VPSID &novnc= VPSID
Parameters
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | vnc | The action which will return data belonging to a particular page | Yes |
svs | GET | VPSID | Provide vpsid of which you want the information. | Yes |
novnc | GET | VPSID | Provide vpsid to get vnc information of particular vps. | Yes |
Sample Code
PHP
<?php
require_once('./virt/virtualizor/sdk/enduser.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'host_ip';
$v = new Virtualizor_Enduser_API($ip, $key, $pass);
$vid = 6710;//vps id
$vps = $v->vnc($vid);
print_r(json_encode($vps));
?>
Curl
curl -k -L "https://hostname:4083/index.php?act=vnc&svs=6710&novnc=6710&do=add&api=json&apikey=your_api_key&apipass=your_api_pass"
Output
{
"port":"5951",
"ip":"xx.xx.xx.xx",
"password":"xxxxxxxxxx",
"novnc":1
}