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://vm1.apivps.com:4083/index.php?act=users

Parameters

Name Type Value Description Required
act GET users The act which has to be carried out to retrieve data Yes
uid POST Int The user id whose users have to be listed Yes
subuserid POST Int If 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://vm1.apivps.com: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, 2023, 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://apivps.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"
}
  • 0 Benutzer fanden dies hilfreich
War diese Antwort hilfreich?

Related Articles

Add SSH Key

This article provides a guide for a VPS Reseller user to add SSH key via API. Use Add SSH key...

Cloud Resources

This article provides a guide for a VPS Reseller user to get cloud resources available to the...

Delete VM

This article provides a guide for a VPS Reseller user to delete VM via API. Use Delete VM API to...

Add ISO

This article provides a guide for a VPS Reseller user to add a new ISO to a VPS via API. Use Add...

List SSH Keys

This article provides a guide for a VPS Reseller user to list SSH keys via API. Use List SSH...