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

Define Reseller Packages and Limits — setresellerpackagelimit

This function allows you to control which packages resellers are able to use. It also allows you to define the number of times a package can be used by a reseller.

Calling Functions

Using the XML API

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

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

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

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

  • 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 setresellerpackagelimit function takes the following variables as input.

The following input variables are required:

  • user (string) — The reseller's username.
  • no_limit (boolean) — Whether or not to impose package limits on the reseller.
    • 1 — imposes no limits.
    • 0 — imposes package limits.
  • package (string) — The package for which the reseller's settings will be modified.
    • note Note: This variable is required unless no_limit is set to 1.

The following input variables are optional:

  • allowed (boolean) — Enables or disables the reseller's access to the package specified in the package variable.
    • 1 — Allows the reseller to use the specified package.
    • 0 — Prohibits the reseller from using the specified package.
  • number (integer) — Specifies the maximum number of times that package can be used by the reseller.

Output

Show Hide

  • setresellerpackagelimit — Root-level XML tag for the output of the setresellerpackagelimit function.
    • result — Container for the results of the function.
      • status (boolean) — Status of the operation.
        • 1 — success.
        • 0 — failure.
      • statusmsg — Information about the status of the request.

Examples

XML API

Show Hide

Calling https://example.com:2087/xml-api/setresellerpackagelimit?user=user123&no_limit=0&package=gold&allowed=1&number=100 in WebHost Manager will produce output similar to:

<setresellerpackagelimit>
     <result>
            <status>1</status>
            <statusmsg>Successfully set reseller package limit.</statusmsg>
      </result>
</setresellerpackagelimit>

JSON API

Show Hide

Calling https://example.com:2087/json-api/setresellerpackagelimit?user=user123&no_limit=0&package=gold&allowed=1&number=100 in WebHost Manager will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Successfully set reseller package limit."
      }
   ]
}

Topic revision: r4 - 26 Jul 2010 - 22:17:20 - Main.JustinSchaefer