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

 

Description

This function lists suspended accounts on the server.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/listsuspended
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/listsuspended
 Command Line
whmapi1 listsuspended


Notes:

  • 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": {
    "account": [
      {
        "owner": "root",
        "time": "Tue Jul  9 09:17:43 2013",
        "reason": "Too many pictures of cats",
        "is_locked": "0",
        "user": "example",
        "Unixtime": 1373379463
      }
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "listsuspended"
  }
}
 Output (XML)
<result>
    <data>
        <account>
            <owner>root</owner>
            <time>Tue Jul 9 09:17:43 2013</time>
            <reason>Too many pictures of cats</reason>
            <is_locked>0</is_locked>
            <user>example</user>
            <Unixtime>1373379463</Unixtime>
        </account>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>listsuspended</command>
    </metadata>
</result>


Note:

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

   

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
accountarray of hashesAn array of hashes of suspended account data.Each hash contains the owner, reason, time, Unixtime, user, and is_locked returns. 

owner

string

The account's owner.

The function returns this value in the account array.

  • root
  • A reseller's username.
  • The account's username.
owner_username

reason

string

The reason why the account is suspended, if one exists.

The function returns this value in the account array.

A valid string.

Suspended for nonpayment.

time

string

The current date and time.

The function returns this value in the account array.

The date and time in Day Mon DD HH:mm:SS YYYY human-readable format, where:

  • Day represents the day of the week as a three-letter abbreviation.
  • Mon represents the month's three-letter abbreviation.
  • DD represents the date.
  • HH represents the hour.
  • mm represents the minute.
  • SS represents the second.
  • YYYY represents the year.
Thu Nov 18 10:34:34 2014

Unixtime

integer

The current date and time.

The function returns this value in the account array.

A date in Unix time format.1416306874

user

string

The account's username.

The function returns this value in the account array.

A valid cPanel username.username

is_locked

Boolean

Whether the account is locked.

Note:

We introduced this return in cPanel & WHM version 11.40.

The function returns this value in the account array.

  • 1 — Locked.
  • 0 — Not locked.
0