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

Allocate IP Addresses to a Reseller — setresellerips

This function will add IP addresses to a reseller account.

Calling Functions

Using the XML API

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

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

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

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

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

The following variable is required:

  • user (string) — The reseller's username.

The following variable is optional:

  • ips (string) — A comma-separated list of IP addresses to allocate to the reseller account. Example: 127.0.0.1, 127.0.0.2, 127.0.0.3. When called without this parameter, the reseller's IP list will be cleared.
  • delegate (boolean) — Passing 1 to this parameter requires resellers to choose a dedicated IP address. Passing 0 to this parameter indicates that resellers will use the main shared IP address.

Output

Show Hide
  • setresellerips — Root-level XML tag for the output of the setresellerips function.
    • result — Container for the results of the function.
      • status (boolean) — The status of the request.
        • 1 — success.
        • 0 — failure.
      • statusmsg (string) — Any additional information about the request.

Examples

XML API

Show Hide

Calling https://example.com:2087/xml-api/setresellerips?user=user123&ips=127.0.0.1,127.0.0.2,127.0.0.3 in WebHost Manager will produce output similar to:

<setresellerips>
     <result>
            <status>1</status>
            <statusmsg>
            Successfully configured IP addresses delegation to reseller.
            </statusmsg>
      </result>
</setresellerips>

JSON API

Show Hide

Calling https://example.com:2087/json-api/setresellerips?user=user123&ips=127.0.0.1,127.0.0.2,127.0.0.3 in WebHost Manager will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Successfully configured IP addresses delegation to reseller."
      }
   ]
}

Topic revision: r8 - 26 Jul 2010 - 22:17:06 - Main.JustinSchaefer