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

List Suspended Accounts — listsuspended

This function will generate a list of suspended accounts.

Calling Functions

Using the XML API

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

  • Append the /xml-api/listsuspended 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/listsuspended

  • 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 listsuspended function from within your custom script:

  • Append the /json-api/listsuspended 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/listsuspended

  • 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

None

Output

  • listsuspended — Root-level XML tag for the output of the listsuspended function.
    • accts — Container for the list of suspended accounts.
      • owner (string) — The account owner's username.
        • note Note: This could be a reseller, the root user, or the account's username.
      • reason (string) — The reason, if there is one, for the account's suspension.
      • 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.
      • time (string) — The current date and time.
        • Expressed as: day, month, date, time, year.
      • unixtime (integer) — The current date and time expressed in Unix time.
      • user (string) — The account user's username.
    • status (boolean) — The outcome of the request.
      • 1 — sucess.
      • 0 — failure.
    • statusmsg (string) — Any additional information regarding the request.

Examples

XML API

Calling https://example.com:2087/xml-api/listsuspended in WebHost Manager will produce output similar to:

<listsuspended>
    <accts>
        <is_locked>0</is_locked>
        <owner>user123</owner>
        <reason>Late Payment</reason>
        <time>Wed May 20 14:51:02 2009</time>
        <unixtime>1242849062</unixtime>
        <user>user123</user>
    </accts>
    <status>1</status>
    <statusmsg>Ok</statusmsg>
</listsuspended>

JSON API

Calling https://example.com:2087/json-api/listsuspended in WebHost Manager will produce output similar to:

{
   "status":1,
   "statusmsg":"Ok",
   "accts":[
      {
         "is_locked":0,
         "reason":"Unknown",
         "unixtime":1242056074,
         "owner":"user123",
         "user":"user123",
         "time":"Mon May 11 10:34:34 2009"
      }
   ]
}

Topic revision: r3 - 10 Oct 2013 - 21:35:49 - Main.LaurenceSimon