List User

Use List User API to list all the users which are under cloud user.

This function is for cloud user

HTTP Request

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

Parameters

NameTypeValueDescriptionRequired
actGETusersThe act which has to be carried out to retrieve dataYes
uidPOSTIntThe user id whose users have to be listedYes
subuseridPOSTIntIf user is cloud user and you have to search users added by cloud user than pass userid of that users separated by comma for multiple users NO

Sample Code

PHP

<?php

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

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_Server_ip';

    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);
    $uid = 321;
    $post['subuserid'] = '3,4,5';//if want to search users added by cloudusers
    $output = $admin->users($uid, $post);

    print_r(json_encode($output));

?>

Curl


curl  -k -X POST -d "subuserid=USERID" -L "https://hostname:4083/index.php?act=users 
&api=json&apikey=your_api_key 
&apipass=your_api_pass"

Output

{
    "uid": "321",
    "act": "users",
    "timezone": 1,
    "timenow": "September 20, 2016, 3: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": "Users",
    "user_list": {
        "376": {
            "uid": "376",
            "password": "xxxxxxxxxxxxxxxxxxx",
            "email": "test123@test.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"
        },
        "377": {
            "uid": "377",
            "password": "xxxxxxxxxxxxxxxxxxx",
            "email": "test234@test.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"
        }
    },
    "time_taken": "0.080"
}
Was this helpful to you?