Get Virtualizor

Account Password

Use Account Password API to reset your account password on server.

HTTP Request

https://hostname:4083/index.php?act=userpassword

Parameters

NameTypeValueDescriptionRequired
actGETuserpasswordThe action specified to perform the operation and return the dataYEs
newpassPOSTnewpassThe new password to be setYes
confirmPOSTconfirmConfirmation for the passwordYes
changepassPOST1If set, then the password of the user will be changedYes

Sample Code

PHP

<?php
   require_once('/usr/local/virtualizor/sdk/enduser.php');

    $key =  '';
    $pass = '';
    $ip = '';
    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);

    $post = array();
    $post['newpass'] = 'test@123';
    $post['conf'] = 'test@123';
    $post['changepass'] =1;

    $output = $admin->userpassword($post);

    print_r(json_encode($output));
?>

Curl

 curl -k -X POST -d "changepass=1&newpass=test123&conf=test123" 
-L "https://hostname:4083/index.php?act=userpassword&api=json& 
apikey=your_api_key&apipass=your_api_pass&do=1"

Output

{
    "uid": "321",
    "act": "userpassword",
    "timezone": 1,
    "timenow": "September 23, 2016, 5:49 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": "Users Password",
    "done": {
        "msg": "Your Password has been changed successfully"
    },
    "time_taken": "0.098"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list