Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

Show an Account's Information — accountsummary

For cPanel & WHM 11.32

This function displays pertinent information about a specific account.

Calling Functions

Using the XML API

To use the XML API to perform the accountsummary function from within your custom script:

  • Append the /xml-api/accountsummary function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/accountsummary

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the accountsummary function from within your custom script:

  • Append the /json-api/accountsummary function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/accountsummary

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

Input

The accountsummary function takes the following required variable as input:

  • user — Username associated with the acount you wish to display.

Output

  • accountsummary — Root-level XML tag for the output of the accountsummary function.
    • acct — Container for the account information.
      • disklimit (string) — Disk space usage limit for the account, in Megabytes.
      • diskused (string) — Current disk space usage for the account, in Megabytes.
      • domain (string) — Name of the root domain for the account.
      • email (string) — Contact email address for the account.
      • ip (string) — The IP address of the root domain on the account.
      • is_locked (boolean) — The status of the account. This parameter is only available in version 11.40+.
        • 1 — The account is locked. Only root and root -enabled resellers can unlock the account.
        • 0 — The account is unlocked.
      • maxaddons(int) — The maximum number of Addon Domains available to the account.
      • maxftp(int) — The maximum number of FTP accounts available to the account.
      • maxlst(int) — The maximum number of mailing lists available to the account.
      • maxparked(int) — The maximum number of parked domains available to the account.
      • maxpop(int) — The maximum number of email account available to the account.
      • maxsql(int) — The maximum number of SQL databases available to the account.
      • maxsub(int) — The maximum number of subdomains available to the account.
      • owner (string) — Reseller or root owner of the account.
      • partition (string) — The disk/partition that the user's home directory is located on.
      • plan (string) — Hosting package associated with the account.
      • shell (string) — The current shell the account is set to use.
      • startdate (string) — The date the account was created.
      • suspended — Shows whether an account is suspended or not.
        • 1 — yes.
        • 0 — no.
      • suspendedreason (string) — Account suspension reason. This is added by the reseller/user who suspended the account.
      • theme (string) — cPanel interface theme associated with the account.
      • unix_startdate (integer) — Date and time the account was created. Format: Unix time.
      • user (string) — Username associated with the account.
      • MAX_EMAIL_PER_HOUR (integer) — The maximum number of emails the account can send in an hour. This parameter's default value is unlimited. This parameter is only available in version 11.32+.
      • MAX_DEFER_FAIL_PERCENTAGE (integer) — The percentage of failed or deferred email messages the account can send per hour before outgoing mail is rate-limited. The system only applies this value after the MIN_DEFER_FAIL_TO_TRIGGER_PROTECTION value is met. This parameter's default value is unlimited. This parameter is only available in version 11.32+.
      • MIN_DEFER_FAIL_TO_TRIGGER_PROTECTION (integer) — The minimum number of failed or deferred email messages the account can send before outgoing mail is subject to rate-limiting (according to the percentage set by the MAX_DEFER_FAIL_PERCENTAGE value). This parameter's default value is unlimited. This parameter is only available in version 11.32+.
    • status (boolean) — Status of the operation.
      • 1 — success.
      • 0 — failure.
    • statusmsg (string) — Relevant information about the operation.

Examples

XML API

Calling this URL in WebHost Manager:

https://example.com:2087/xml-api/accountsummary?user=username

will produce output similar to:

<accountsummary> 
     <acct>
            <disklimit>1000M</disklimit>
            <diskused>172M</diskused>
            <domain>domain.tld</domain>
            <email>email@domain.tld</email>
            <ip>127.0.0.1</ip>
            <owner>root</owner>
            <partition>home</partition>
            <plan>reseller_planname</plan>
            <startdate>04 May 8 21:12</startdate>
            <suspended>1</suspended>
            <suspendedreason>Account suspended due to hosting of pirated software.</suspendedreason>
            <theme>x3</theme>
            <unix_startdate>1104173413</unix_startdate>
            <user>username</user>
            <is_locked>0</is_locked>
      </acct>
      <status>1</status>
      <statusmsg>Ok</statusmsg> 
</accountsummary> 

JSON API

Calling this URL in WebHost Manager:

https://example.com:2087/json-api/accountsummary?user=username

will produce output similar to:

{
   "status":1,
   "statusmsg":"Ok",
   "acct":[
      {
         "partition":"home",
         "startdate":"09 May 19 07:49",
         "plan":"level3 ",
         "suspended":0,
         "theme":"x3",
         "user":"gus",
         "unix_startdate":1242737345,
         "suspendreason":"not suspended",
         "suspendtime":null,
         "ip":"127.0.0.1",
         "domain":"example.com",
         "diskused":"0M",
         "owner":"username",
         "email":"*unknown*",
         "disklimit":"unlimited"
         "is_locked":0,
      }
   ]
}

Topic revision: r7 - 10 Oct 2013 - 21:38:14 - Main.LaurenceSimon