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

 

Description

This function lists a reseller's available IP addresses.

Examples 


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


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",
         "192.168.0.21",
         "192.168.0.22",
         "192.168.0.23",
      ],
      "all":1
   },
   "metadata":{  
      "version":1,
      "reason":"OK",
      "result":1,
      "command":"getresellerips"
   }
}
 Output (XML)
<result>
    <data>
        <ip>192.168.0.20</ip>
        <ip>192.168.0.21</ip>
        <ip>192.168.0.22</ip>
        <ip>192.168.0.23</ip>
        <all>1</all>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>getresellerips</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

A reseller's username, to query only that reseller.

If you do not specify a value, the function lists available IP addresses for the root user.

A valid WHM username on the server.

username

 

Returns

ReturnTypeDescriptionPossible valuesExample
iparrayThe reseller's available IP addresses.An array of available IP addresses.10.0.0.1
allBooleanWhether all of the reseller's IP addresses are available.
  • 1 — All of the reseller's IP addresses are available.
  • 0 — Some or all IP addresses are unavailable.
1