buy
List Users

Description

Use the List Users API to List Users on your server.

The API response will be list of users.

Parameters


Sample Code

curl --insecure -u "user_name:password" "https://hostname:2005/index.php?api=json&act=users"
<?php
$user = 'user_name';
$pass = 'password';
 
$url = 'https://'.rawurlencode($user).':'.rawurlencode($pass).'@hostname:2005/index.php?api=json&act=users';  

// Set the curl parameters 
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 

// Get response from the server. 
$resp = curl_exec($ch);

// The response will hold a string as per the API response method. In this case its PHP Serialize
$res = json_decode($resp, true);

echo "<pre>";
print_r($res['users']);
echo "</pre>";
<?php
include_once('/usr/local/webuzo/sdk/webuzo_sdk_v2.php');
$user = 'user_name';
$pass = 'password';
$host = 'hostname';

$webuzo = new Webuzo_Admin_SDK($user, $pass, $host);

$res = $webuzo->list_users();

echo "<pre>";
print_r($res['users']);
echo "</pre>";

?>

Output

[demouser] => Array
        (
            [id] => 1
            [uuid] => xxxxxxxx
            [user] => demouser
            [owner] => root
            [serid] => 
            [email] => dom@example.com
            [domain] => example.com
            [type] => 1
            [plan] => 
            [demo] => 
            [status] => 
            [homedir] => /home/demouser
            [space] => []
            [shell] => 0
            [deny_cron] => 0
            [force_password] => 0
            [created] => 9999999
            [ipv6] => 
            [ips] => Array
                (
                    [all] => Array
                        (
                            [hostname] => Array
                                (
                                    [ip] => "ip_address"
                                    [type] => 4
                                )

                        )

                    [4] => Array
                        (
                            [0] => "ip_address"
                        )
                )

            [ip] => "ip_address"
            [resource] => Array
                (
                    [disk] => Array
                        (
                            [label] => Disk Usage
                            [used] => 0B
                            [limit] => 0B
                            [percent] => 0
                            [limit_bytes] => 0
                            [used_bytes] => 0
                        )

                    [inode] => Array
                        (
                            [label] => Inode Usage
                            [used] => 0
                            [limit] => unlimited
                            [percent] => 0
                        )

                    [bandwidth] => Array
                        (
                            [label] => Bandwidth Usage
                            [limit] => unlimited
                            [used] => 0B
                            [percent] => 0
                            [limit_bytes] => unlimited
                            [used_bytes] => 0
                        )

                    [ftp] => Array
                        (
                            [label] => FTP Account Usage
                            [limit] => unlimited
                            [used] => 0
                            [percent] => 0
                        )

                    [email_account] => Array
                        (
                            [label] => Email Account Usage
                            [limit] => unlimited
                            [used] => 1
                            [percent] => 0
                        )

                    [db] => Array
                        (
                            [label] => Database Usage
                            [limit] => unlimited
                            [used] => 0
                            [percent] => 0
                        )

                    [dbdisk] => Array
                        (
                            [label] => Database Disk Usage
                            [limit] => unlimited
                            [used] => 0B
                            [percent] => 0
                        )

                    [addondom] => Array
                        (
                            [label] => Addon Domains
                            [limit] => unlimited
                            [used] => 0
                            [percent] => 0
                        )

                    [parkeddom] => Array
                        (
                            [label] => Parked Domains
                            [limit] => unlimited
                            [used] => 1
                            [percent] => 0
                        )

                    [aliasdom] => Array
                        (
                            [label] => Alias Domains
                            [limit] => unlimited
                            [used] => 0
                            [percent] => 0
                        )

                    [subdom] => Array
                        (
                            [label] => Subdomains
                            [limit] => unlimited
                            [used] => 0
                            [percent] => 0
                        )

                    [autorespond] => Array
                        (
                            [label] => Autoresponder
                            [limit] => unlimited
                            [used] => 0
                            [percent] => 0
                        )

                    [aliasemail] => Array
                        (
                            [label] => Alias Email
                            [limit] => unlimited
                            [used] => 0
                            [percent] => 0
                        )

                )

        )
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list