Use VNC Password API to set new VNC password of VPS on your server.
HTTP Request
https://hostname:4083/index.php?act=vncpass&svs=vid
Parameters
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | vncpass | The action specified to return data. ** (FOR KVM)** | Yes |
svs | POST | Int | The vps whose vnc password needs to be changed. This will be passed to the url | Yes |
vid | POST | Int | The vpsid whose VNC password needs to be changed. This will be passed as a POST parameter | Yes |
vncpass | POST | vncpass | The new password that needs to be changed | Yes |
conf | POST | conf | Confirming the entered password | Yes |
Sample Code
PHP
<?php
require_once('/usr/local/virtualizor/sdk/enduser.php');
$key = '';
$pass = '';
$ip = '';
$admin = new Virtualizor_Enduser_API($ip, $key, $pass);
$vid = 3384;
$pass = 'tesfher';
$output = $admin->vncpass($vid, $pass);
print_r(json_encode($output));
?>
Curl
curl -k -X POST -d "vncpass=1&newpass=testawc&conf=testawc"
-L "https://hostname:4083/index.php?act=vncpass&svs=3577&api=json&
apikey=your_api_key&apipass=your_api_pass&do=1"
Output
{
"uid": "321",
"act": "vncpass",
"timezone": 1,
"timenow": "September 23, 2016, 6:58 am",
"vpsid": "3008",
"username": "test@test.com",
"user_type": "2",
"preferences": {
"fname": "test",
"lname": "test",
"language": "english",
"theme": "default",
"timezone": 1,
"logo": ""
},
"url": "index.php?",
"rdns": {
"pdnsid": null
},
"support_link": "http://softaculous.com",
"disable_login_logo": 1,
"title": "Change VNC Password",
"done": {
"msg": "Your VNC Password has been changed successfully."
},
"time_taken": "0.259"
}