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 Packages — listpkgs

This function lists all hosting packages available for use by the WHM user who is currently logged in. If that user is a reseller, he or she may not see some packages that exist, if those packages are not currently available to be used for account creation.

Calling Functions

Using the XML API

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

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

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

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

  • 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

  • listpkgsroot level XML tag for the output of the listpkgs function.
    • package — Container for the hosting package information.
      • name (string) — Name of the hosting package.
      • BWLIMIT (string) — Bandwidth usage limit associated with the package (in Megabytes).
      • CGI (string) — Whether or not the account will have the ability to execute CGI scripts.
        • y — yes.
        • n — no.
      • CPMOD (string) — Name of the theme associated with the package.
      • DIGESTAUTH (string) — Whether or not the account will have digest authentication enabled.
        • y — yes.
        • n — no.
      • FEATURELIST (string) — Name of the feature list associated with the package.
      • FRONTPAGE (string) — Whether or not FrontPage extensions are enabled on the account.
        • y — yes.
        • n — no.
      • HASSHELL (string) — Whether or not the account will have SSH access.
        • y — yes.
        • n — no.
      • IP (string) — Whether or not the account will have a dedicated IP.
        • y — yes.
        • n — no.
      • LANG (string) — The interface language used by accounts set to this package.
      • MAXADDON (string) — Number of addon domains the account will be able to create.
      • MAXFTP (string) — Number of FTP accounts the account will be able to create.
      • MAXLST (string) — Number of mailing lists the account will be able to create.
      • MAXPARK (string) — Number of parked domains the account will be able to create.
      • MAXPOP (string) — Number of email accounts the account will be able to create.
      • MAXSQL (string) — Number of SQL (MySQL and PostgreSQL) databases the account will be able to create.
      • MAXSUB (string) — Maximum number of subdomains the account will be able to create.
      • QUOTA (string) — Disk space usage quota associated with the package (in Megabytes).
      • MAX_EMAIL_PER_HOUR (integer) — The maximum number of emails the account can send in an hour. This parameter's default value is unlimited.
      • 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. This parameter's default value is unlimited.
      • _PACKAGE_EXTENSIONS (space delimited) — The package extensions associated with this package. This parameter is only available in version 11.40+.
        note Note: If you have one or more package extensions associated with the package, you will also see the variables associated with the extension. Consult the documentation for the extension for a list of possible variables.

Examples

XML API

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

<listpkgs>
     <package>
            <name>gold</name>
            <BWLIMIT>unlimited</BWLIMIT>
            <CGI>y</CGI>
            <CPMOD>x3</CPMOD>
            <DIGESTAUTH>y</DIGESTAUTH>
            <FEATURELIST>default</FEATURELIST>
            <FRONTPAGE>y</FRONTPAGE>
            <HASSHELL>y</HASSHELL>
            <IP>n</IP>
            <LANG>english</LANG>
            <MAXADDON>2</MAXADDON>
            <MAXFTP>unlimited</MAXFTP>
            <MAXLST>unlimited</MAXLST>
            <MAXPARK>2</MAXPARK>
            <MAXPOP>unlimited</MAXPOP>
            <MAXSQL>unlimited</MAXSQL>
            <MAXSUB>unlimited</MAXSUB>
            <QUOTA>unlimited</QUOTA>
            <_PACKAGE_EXTENSIONS>package extension</_PACKAGE_EXTENSIONS>
      </package>
</listpkgs>

JSON API

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

{
   "package":[
      {
         "FRONTPAGE":"y",
         "CPMOD":"x3",
         "FEATURELIST":"default",
         "BWLIMIT":"unlimited",
         "IP":"n",
         "CGI":"y",
         "DIGESTAUTH":"y",
         "MAXSUB":"unlimited",
         "name":"standard",
         "MAXSQL":"unlimited",
         "MAXFTP":"unlimited",
         "QUOTA":"unlimited",
         "MAXPARK":"2",
         "HASSHELL":"y",
         "MAXADDON":"2",
         "MAXPOP":"unlimited",
         "MAXLST":"unlimited",
         "LANG":"english"
         "_PACKAGE_EXTENSIONS":"package extension"
      },
      {
         "FRONTPAGE":"y",
         "CPMOD":"x3",
         "DIGESTAUTH":"y",
         "FEATURELIST":"Default",
         "BWLIMIT":"9999",
         "IP":"y",
         "CGI":"y",
         "MAXSUB":"888",
         "name":"bronze",
         "MAXSQL":"99",
         "MAXFTP":"9",
         "QUOTA":"unlimited",
         "MAXPARK":"88",
         "HASSHELL":"y",
         "MAXADDON":"888",
         "MAXPOP":"999",
         "MAXLST":"999",
         "LANG":"english"
         "_PACKAGE_EXTENSIONS":"package extension"
      },
      {
         "FRONTPAGE":"n",
         "CPMOD":"x3",
         "DIGESTAUTH":"y",
         "FEATURELIST":"default",
         "BWLIMIT":"unlimited",
         "IP":"n",
         "CGI":"y",
         "MAXSUB":"unlimited",
         "name":"silver",
         "MAXSQL":"unlimited",
         "MAXFTP":"unlimited",
         "QUOTA":"unlimited",
         "MAXPARK":"0",
         "HASSHELL":"y",
         "MAXADDON":"0",
         "MAXPOP":"unlimited",
         "MAXLST":"unlimited",
         "LANG":"english"
         "_PACKAGE_EXTENSIONS":"package extension"
      },
      {
         "FRONTPAGE":"y",
         "CPMOD":"x3",
         "DIGESTAUTH":"y",
         "FEATURELIST":"default",
         "BWLIMIT":"unlimited",
         "MAXSUB":"unlimited",
         "CGI":"y",
         "IP":"n",
         "name":"gold",
         "MAXSQL":"unlimited",
         "MAXPARK":"2",
         "QUOTA":"unlimited",
         "MAXFTP":"unlimited",
         "HASSHELL":"y",
         "MAXADDON":"2",
         "LANG":"english",
         "MAXLST":"unlimited",
         "MAXPOP":"unlimited"
         "_PACKAGE_EXTENSIONS":"package extension"
      }
   ]
}

Topic revision: r12 - 19 Sep 2013 - 16:26:21 - Main.SarahHaney