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

Edit an Account's Quota — editquota

This function changes an account's disk space usage quota.

Calling Functions

Using the XML API

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

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

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

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

  • 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

The editquota function takes the following variables as input. Both of these variables are required:

  • user (string) — User name of the account. Example: user
  • quota (integer) — The user's new disk space quota, in Megabytes. Example: 500

Output

  • editquota (string) — Root-level XML tag for the output of the editquota function.
    • output (string) — Internal data used by WHM.
    • result — Container for the results of the editquota request.
      • status (boolean) — Status of the request.
        • 1 — success.
        • 0 — failure.
      • statusmsg (string) — Detailed message about the status of the request.

Examples

XML API

Calling this URL from WebHost Manager:

https://example.com:2087/xml-api/editquota?user=john&quota=50

will produce output similar to the following:

<editquota>
     <output>Using Quota v3 Support</output>
     <result>
          <status>1</status>
          <statusmsg>Set quota for user.</statusmsg>
     </result>
</editquota>

JSON API

Calling this URL from WebHost Manager:

https://example.com:2087/json-api/editquota?user=john&quota=50

will produce output similar to the following:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Set quota for user."
      }
   ],
   "output":"Using Quota v3 Support\n"
}

Topic revision: r4 - 26 Jul 2010 - 22:14:18 - Main.JustinSchaefer