Page tree
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
whmapi0 listsuspended

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 0 documentation or run the whmapi0 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
   "status":1,
   "statusmsg":"Ok",
   "accts":[
      {
         "reason":"Unknown",
         "unixtime":1242056074,
         "owner":"user123",
         "user":"user123",
         "is_locked":"0",
         "time":"Mon May 11 10:34:34 2009"
      }
   ]
}
 Output (XML)
<listsuspended>
    <accts>
        <owner>user123</owner>
        <reason>Late Payment</reason>
        <time>Wed May 20 14:51:02 2009</time>
        <is_locked>0</is_locked>
        <unixtime>1242849062</unixtime>
        <user>user123</user>
    </accts>
    <status>1</status>
    <statusmsg>Ok</statusmsg>
</listsuspended>

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
acctsarray of hashesA hash of suspended account data.This hash includes the owner, reason, time, unixtime, user, and is_locked returns. 

owner

string

The account's owner.

The function returns this value in the accts hash.

  • 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 accts hash.

A valid string.

Suspended for nonpayment.

time

string

The current date and time.

The function returns this value in the accts hash.

The date in YYYY-MM-DD HH-mm-SS human-readable format, where:

  • YYYY represents the year.
  • MM represents the month.
  • DD represents the date.
  • HH represents the hour.
  • mm represents the minute.
  • SS represents the second.
Thu Nov 18 10:34:34 2014

unixtime

integer

The current date and time.

The function returns this value in the accts hash.

A date in Unix time format.1416306874

user

string

The account's username.

The function returns this value in the accts hash.

Note:

This return only appears in cPanel & WHM version 11.40+. 

A valid cPanel username.username

is_locked

Boolean

Whether the account is locked.

The function returns this value in the accts hash.

  • 1 — Locked.
  • 0Not locked.
0

status

BooleanWhether the system successfully called the function.
  • 1 — Success.
  • 0 — Failure.

 

1
statusmsgstringA message of success or a reason for failure.
  • Ok
  • An error message.
Ok