Child pages
  • WHM API 1 Functions - setresellerips
Skip to end of metadata
Go to start of metadata

Description

This function adds IP addresses to a reseller's account.

Note:

To assign a main IP address to a reseller's account, call the WHM API 1 setresellermainip function.

For more information, read our Manage Reseller's IP Delegation documentation.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/setresellerips?api.version=1&user=username&ips=192.168.0.20&delegate=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/setresellerips?api.version=1&user=username&ips=192.168.0.20&delegate=1
 Command Line
whmapi1 setresellerips user=username ips=192.168.0.20 delegate=1


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
  "data": {
    "ip": [
      "192.168.0.20"
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "setresellerips"
  }
}
 Output (XML)
<result>
    <data>
        <ip>192.168.0.20</ip>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>setresellerips</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The reseller's username.

A valid username.username
ipsstring

The IP addresses to allocate to the reseller's account.

If you do not use this parameter, the function clears the reseller's IP address list.

A comma-separated list of IP addresses.192.168.0.20
delegateBoolean

Whether to allocate the reseller a dedicated IP address.

This parameter defaults to 0.

    • 1 — Restrict the reseller's account to its dedicated IP address.
    • 0 — Allow the user to dedicate any available IP address to an owned account.
1

Returns

ReturnTypeDescriptionPossible valuesExample
allBoolean

Whether the function allocated all available IP addresses to the reseller.

This return only appears if you set the delegate parameter to 0.

1 is the only possible value.1

ip

array

An array of the reseller's allocated IP addresses.

The ips input parameter's value.

192.168.0.20