Child pages
  • WHM API 0 - Return Data
Skip to end of metadata
Go to start of metadata

 

Introduction

WHM API 0 outputs data in either JSON or XML format. The output format depends on the options that you choose when you call the function.

Warning:

WHM API 0 is deprecated. We strongly recommend that you only use the equivalent WHM API 1 functions instead. 

Basic return data  

Both JSON and XML output return data as hashes or arrays of hashes. In XML output, <functionname> tags wrap the top-level hash of data, where functionname is the function's name.

The top-level hash of data includes a hash of the function's output data, as well as the function's metadata.

  • In the following examples, the output data is in the acct hash.
  • The output data's hash's name varies from function to function.
  • Check the desired function's documentation for an accurate outline of the output's structure.

Example

The accountsummary function returns typical WHM API 0 output:

{
  "acct": [
    {
      "maxaddons": "unlimited",
      "ip": "192.168.0.128",
      "min_defer_fail_to_trigger_protection": "5",
      "legacy_backup": 0,
      "diskused": "14M",
      "maxftp": "unlimited",
      "startdate": "13 May 22 16:03",
      "max_defer_fail_percentage": "unlimited",
      "disklimit": "unlimited",
      "is_locked": 0,
      "suspendtime": null,
      "email": "username@example.com",
      "domain": "example.com",
      "unix_startdate": 1369256589,
      "user": "username",
      "plan": "packagename",
      "shell": "/bin/bash",
      "maxpop": "unlimited",
      "backup": 0,
      "theme": "paper_lantern",
      "owner": "root",
      "max_email_per_hour": "unlimited",
      "ipv6": [
         
      ],
      "suspendreason": "not suspended",
      "maxlst": "unlimited",
      "suspended": 0,
      "maxsql": "unlimited",
      "maxparked": "unlimited",
      "partition": "home",
      "maxsub": "unlimited"
    }
  ],
  "statusmsg": "Ok",
  "status": 1
}

Remember:

cPanel & WHM version 66 deprecated XML output. 

<accountsummary>
    <acct>
        <backup>0</backup>
        <disklimit>unlimited</disklimit>
        <diskused>14M</diskused>
        <domain>example.com</domain>
        <email>username@example.com</email>
        <ip>192.168.0.128</ip>
        <is_locked>0</is_locked>
        <legacy_backup>0</legacy_backup>
        <max_defer_fail_percentage>unlimited</max_defer_fail_percentage>
        <max_email_per_hour>unlimited</max_email_per_hour>
        <maxaddons>unlimited</maxaddons>
        <maxftp>unlimited</maxftp>
        <maxlst>unlimited</maxlst>
        <maxparked>unlimited</maxparked>
        <maxpop>unlimited</maxpop>
        <maxsql>unlimited</maxsql>
        <maxsub>unlimited</maxsub>
        <min_defer_fail_to_trigger_protection>5</min_defer_fail_to_trigger_protection>
        <owner>root</owner>
        <partition>home</partition>
        <plan>packagename</plan>
        <shell>/bin/bash</shell>
        <startdate>13 May 22 16:03</startdate>
        <suspended>0</suspended>
        <suspendreason>not suspended</suspendreason>
        <suspendtime/>
        <theme>paper_lantern</theme>
        <unix_startdate>1369256589</unix_startdate>
        <user>username</user>
    </acct>
    <status>1</status>
    <statusmsg>Ok</statusmsg>
</accountsummary>