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

Assign the Reseller's Main IP Address — setresellermainip

This function will assign a main, shared IP address to a reseller.

Calling Functions

Using the XML API

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

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

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

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

  • 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 setresellermainip function takes the following required variables as input:
  • user (string) — The reseller's username.
  • ip (string) — The IP address to set as the reseller's main, shared IP.
    • Example: 127.0.0.1

Output

Show Hide

  • setresellermainip — Root-level XML tag for the output of the setresellermainip function.
    • result — Container for the results of the function.
      • status (boolean) — The status of the request.
        • 1 — success.
        • 0 — failure.
      • statusmsg (string) — Additional information regarding the status of the request.

Examples

XML API

Show Hide

Calling https://example.com:2087/xml-api/setresellermainip?user=user123&ip=127.0.0.1 in WebHost Manager will produce output similar to:

<setresellermainip>
     <result>
            <status>1</status>
            <statusmsg>Successfully set main IP address of the reseller.</statusmsg>
      </result>
</setresellermainip>

JSON API

Show Hide

Calling https://example.com:2087/json-api/setresellermainip?user=user123&ip=127.0.0.1 in WebHost Manager will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Successfully set main IP address of the reseller."
      }
   ]
}

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