Get Virtualizor

Change Password

Use Change Password API to change password of VPS on your server.

HTTP Request

https://hostname:4083/index.php?act=changepassword&svs=vpsid

Parameters

NameTypeValueDescriptionRequired
actGETchangepasswordThe action specified to return dataYes
svsPOSTIntThe vpsid whose password needs to be changedYes
newpassPOSTnewpassThe new password of the vpsYes
confPOSTconfConfirmation to change the passwordYes

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;

    $newpass = 'Test123';

    $output = $admin->changepassword($vid, $newpass);

    print_r(json_encode($output));
?>

Curl

curl -k -X POST -d "changepass=1&newpass=test@123&conf=test@123" 
-L "https://hostname:4083/index.php?act=changepassword&svs=3577&api=json&
apikey=your_api_key&apipass=your_api_pass&do=1"

Output

{
    "uid": "321",
    "act": "changepassword",
    "timezone": 1,
    "timenow": "September 23, 2016, 6:20 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 Password",
    "done": {
        "msg": "Your password will be changed when the VPS is booted again"
    },
    "onboot": "Your password will be changed when the VPS is booted again",
    "time_taken": "1.327"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list