Get Virtualizor

Edit User

Use Edit User API to edit existing user on your server.

The function is for cloud user.

HTTP Request

https://hostname:4083/index.php?act=edituser&uid=uid

Parameters

NameTypeValueDescriptionRequired
actGETedituserThe action performed to retrieve dataYes
uidPOSTIntThe user id which needs to be editedYes
edituserPOST1If set then the user info will be editedYes
user_emailPOSTuser_emailEmail id of the userYes
user_passwordPOSTuser_passPassword of the userYes

Sample Code

PHP

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

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

    $uid = 369;
    $post = array();
    $post['edituser'] = 1;
    $post['user_email'] = 'test@test.com';
    $post['user_password'] = 'xxxxxxxxx';   

    $output = $admin->edituser($uid, $post);

    print_r(json_encode($output));
?>

Curl

curl -k -X POST -d "edituser=1&user_email=avin_test@softa.com& 
user_password=test012" -L 
"https://hostname:4083/index.php?act=edituser&uid=383&api=json& 
apikey=your_api_key&apipass=your_api_pass&do=1"

Output

{
    "uid": "321",
    "act": "edituser",
    "timezone": 1,
    "timenow": "September 23, 2016, 5:22 am",
    "vpsid": "3008",
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "test",
        "lname": "test",
        "theme": "default",
        "language": "english",
        "timezone": 1
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": null
    },
    "support_link": "http://softaculous.com",
    "disable_login_logo": 1,
    "title": "Edit User",
    "edit_user": {
        "uid": "383",
        "email": "test425@softa.com",
        "type": "0",
        "aclid": "0",
        "pid": "321",
        "num_vs": "0",
        "num_users": "0",
        "space": "0",
        "ram": "0",
        "burst": "0",
        "bandwidth": "0",
        "cpu": "0",
        "cores": "0",
        "cpu_percent": "0",
        "num_cores": "0",
        "num_ipv4": "0",
        "num_ipv6": "0",
        "num_ipv6_subnet": "0",
        "allowed_virts": "",
        "network_speed": "0",
        "upload_speed": "0",
        "openvz": "0",
        "xen": "0",
        "xenhvm": "0",
        "kvm": "0",
        "sg": null,
        "mg": null,
        "preferences": null,
        "dnsplid": "0",
        "date_created": "0",
        "service_period": "0",
        "band_suspend": "0"
    },
    "done": {
        "msg": "User has been edited",
        "goto": "act=users"
    },
    "time_taken": "0.100"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list