Child pages
  • WHM API 1 Functions - resellerstats
Skip to end of metadata
Go to start of metadata

Description

This function lists data about a reseller's accounts.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/resellerstats?api.version=1&user=username&month=2&year=2019
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/resellerstats?api.version=1&user=username&month=2&year=2019
 Command Line
whmapi1 resellerstats user=username month=2 year=2019


Notes:

  • Unless otherwise noted, you must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
   "data":{
      "reseller":{
         "user":"username",
         "totalbwalloc":"500",
         "totaldiskalloc":"1100",
         "diskquota":0,
         "year":2019,
         "diskused":5.69,
         "bandwidthlimit":0,
         "month":2,
         "totalbwused":0,
         "acct":[
            {
               "deleted":1,
               "domain":"example2.com",
               "package":"deleted account",
               "suspended":1,
               "bandwidthlimit":"0.00",
               "diskquota":0,
               "user":"example2",
               "bandwidthused":"0.00",
               "diskused":"1.61"
            },
            {
               "user":"example1",
               "bandwidthused":"0.00",
               "diskquota":"1100.00",
               "diskused":"1.57",
               "package":"default",
               "domain":"example1.com",
               "deleted":0,
               "bandwidthlimit":"500.00",
               "suspended":0
            },
            {
               "bandwidthlimit":"0.00",
               "suspended":0,
               "package":"default",
               "domain":"example.com",
               "deleted":0,
               "diskused":"2.51",
               "bandwidthused":"0.00",
               "user":"username",
               "diskquota":0
            }
         ],
         "diskoverselling":0,
         "bwoverselling":0
      }
   }
}
 Output (XML)
<result>
    <data>
        <reseller>
            <user>username</user>
            <totalbwalloc>500</totalbwalloc>
            <totaldiskalloc>1100</totaldiskalloc>
            <diskquota>0</diskquota>
			<year>2019</year>
            <diskused>5.69</diskused>
            <bandwidthlimit>0</bandwidthlimit>
			<month>2</month>
            <totalbwused>0</totalbwused>
            <acct>
                <deleted>1</deleted>
                <domain>example2.com</domain>
                <package>deleted account</package>
                <suspended>1</suspended>
                <bandwidthlimit>0.00</bandwidthlimit>
                <diskquota>0</diskquota>
                <user>example2</user>
                <bandwidthused>0.00</bandwidthused>
                <diskused>1.61</diskused>
            </acct>
            <acct>
                <user>example1</user>
                <bandwidthused>0.00</bandwidthused>
                <diskquota>1100</diskquota>
                <diskused>1.57</diskused>
                <package>default</package>
                <domain>example1.com</domain>
                <deleted>0</deleted>
                <bandwidthlimit>500.00</bandwidthlimit>
                <suspended>0</suspended>
            </acct>
            <acct>
                <bandwidthlimit>0.00</bandwidthlimit>
                <suspended>0</suspended>
                <package>default</package>
                <domain>example.com</domain>
                <deleted>0</deleted>
                <diskused>2.51</diskused>
                <bandwidthused>0</bandwidthused>
                <user>username</user>
                <diskquota>0</diskquota>
            </acct>
			<diskoverselling>0</diskoverselling>
            <bwoverselling>0</bwoverselling>
        </reseller>
    </data>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The reseller's username.

A valid reseller username.username
monthinteger

The month to query, in numeric format.

Note:

We added this parameter in cPanel & WHM version 80.

This parameter defaults to the current month.

A positive integer between 1 and 12.

Note:

This value only accepts 1 for the month of January.

2
yearinteger

The year to query, in numeric format.

Note:

We added this parameter in cPanel & WHM version 80.

This parameter defaults to the current year.

A valid year.2019

 

Returns

ReturnTypeDescriptionPossible valuesExample
resellerhashAn array of hashes containing data about a reseller account.Each hash contains the bandwidthlimit, bwoverselling, diskoverselling, diskquota, diskused, month, totalbwalloc, totalbwused, totaldiskalloc, user, and year returns and the acct array of hashes.

bandwidthlimit

integer

The reseller's total bandwidth limit.

This function returns this value in the reseller hash.

  • A positive integer that represents the reseller's bandwidth limit, in Megabytes (MB).
  • 0 — The reseller has unlimited bandwidth.
0

bwoverselling

Boolean

Whether the reseller can oversell bandwidth.

This function returns this value in the reseller hash.

  • 1 — The reseller can oversell bandwidth.
  • 0 — The reseller cannot oversell bandwidth.
0

diskoverselling

Boolean

Whether the reseller can oversell disk space.

This function returns this value in the reseller hash.

  • 1 — The reseller can oversell disk space.
  • 0 — The reseller cannot oversell disk space.
0

diskquota

integer

The reseller's total disk space quota.

This function returns this value in the reseller hash.

  • A positive integer that represents the reseller's disk space quota, in Megabytes (MB).
  • 0 — The reseller has unlimited disk space.
0

diskused

integer

The total amount of disk space that the reseller and all of its accounts use.

Note:

This value does not include disk space the reseller account uses if the root account owns it.

This function returns this value in the reseller hash.

A positive integer that represents the total current disk space use, in Megabytes (MB).5.69

month

integer

The current month or a queried month.

This function returns this value in the reseller hash.

A valid month, in numeric format.2

totalbwalloc

integer

The total amount of bandwidth that the reseller has given to its accounts.

This function returns this value in the reseller hash.

A positive integer that represents an amount of bandwidth, in Megabytes (MB).500

totalbwused

integer

The total amount of bandwidth that the reseller's accounts have used.

This function returns this value in the reseller hash.

A positive integer that represents an amount of bandwidth, in Megabytes (MB).0

totaldiskalloc

integer

The total amount of disk space that the reseller has given to its accounts.

This function returns this value in the reseller hash.

A positive integer that represents an amount of disk space, in Megabytes (MB).1100

user

string

The reseller account's username.

This function returns this value in the reseller hash.

A valid username on the server.username

year

integer

The current year or a queried year.

This function returns this value in the reseller hash.

A valid year, in numeric format.2019

acct

array of hashes

An array of hashes that contains data about all the reseller's accounts.

Note:

This array also returns the reseller account.

This function returns this array of hashes in the reseller hash.

Each hash contains the bandwidthlimit, bandwidthused, deleted, diskquota, diskused, domain, package, suspended, and user returns.

bandwidthlimit

integer

The account's bandwidth limit.

This function returns this value in the acct hash.

  • A positive integer that represents the account's bandwidth limit, in Megabytes (MB).
  • 0 — The account has unlimited bandwidth.
500.00

bandwidthused

integer

The account's current bandwidth use.

This function returns this value in the acct hash.

A positive integer that represents the account's bandwidth use, in Megabytes (MB).0.00

deleted

Boolean

Whether the account has been deleted.

This function returns this value in the acct hash.

  • 1 — Deleted.
  • 0Not deleted.
0

diskquota

integer

The account's disk space quota.

This function returns this value in the acct hash.

  • A positive integer that represents the account's disk space quota, in Megabytes (MB).
  • 0 — The account has unlimited disk space.
1100.00

diskused

integer

The account's current disk space use.

This function returns this value in the acct hash.

A positive integer that represents the account's current disk space use, in Megabytes (MB).1.57

domain

string

The account's main domain.

This function returns this value in the acct hash.

A valid domain on the server.example1.com

package

string

The account's hosting plan (package).

This function returns this value in the acct hash.

A valid package name on the server.default

suspended

Boolean

Whether the account is suspended.

This function returns this value in the acct hash.

  • 1 — Suspended.
  • 0Not suspended.

0

user

string

The account's username.

This function returns this value in the acct hash.

A valid username on the server.example1