Use Account Password API to reset your account password on server.
HTTP Request
https://hostname:4083/index.php?act=userpassword
Parameters
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | userpassword | The action specified to perform the operation and return the data | YEs |
newpass | POST | newpass | The new password to be set | Yes |
confirm | POST | confirm | Confirmation for the password | Yes |
changepass | POST | 1 | If set, then the password of the user will be changed | Yes |
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"
}