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

Set a Reseller's Nameservers — setresellernameservers

This function allows you to define a reseller's nameservers. Additionally, you may use it to reset a reseller's nameservers to the default settings.

Calling Functions

Using the XML API

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

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

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

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

  • 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 setresellernameservers function takes the following required variable as input:

  • user (string) — Username of the reseller whose nameservers you wish to reset.

This function also takes the following optional variable as input:

  • nameservers (string) — IP addresses of the reseller's new nameservers. You can add multiple nameservers by separating them with a comma.
    • Example: nameservers=ns1.example.com,ns2.example.com
    • note Note: If this parameter is not specified, the reseller's nameservers will be reset to the default setting.

Output

  • setresellernameservers — Root-level XML tag for the output of the setresellernameservers function.
    • result — Container for the information about the setresellernameservers function call.
      • status (boolean) — Whether the call was successful.
        • 1 — success.
        • 0 — failure.
      • statusmsg (string) — Status or error message about the setresellernameservers function call.

Examples

XML API

Calling the following function in WebHost Manager:

https://example.com:2087/xml-api/setresellernameservers?user=joe&nameservers=127.0.0.1

will produce output similar to:

<setresellernameservers>
     <result>
          <status>1</status>
          <statusmsg>Set resellers nameservers.</statusmsg>
     </result>
</setresellernameservers>

JSON API

Calling the following function in WebHost Manager:

https://example.com:2087/json-api/setresellernameservers?user=joe&nameservers=127.0.0.1

will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Set resellers nameservers."
      }
   ]
}

Topic revision: r3 - 30 Sep 2011 - 14:19:17 - Main.JustinSchaefer