Description

This function assigns a main IP address to a reseller's account.

To assign additional IP addresses to a reseller's account, use WHM API 0's setresellerips function.

Examples 


https://hostname.example.com:2087/cpsess##########/json-api/setresellermainip?user=username&ip=192.168.0.20
https://hostname.example.com:2087/cpsess##########/xml-api/setresellermainip?user=username&ip=192.168.0.20
whmapi0 setresellermainip user=username ip=192.168.0.20

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

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The reseller's username.

A valid reseller username on the server.username
ipstring

Required

The IP address to assign to the reseller's account as the main shared IP address.

A valid IP address.192.168.0.20

Returns

ReturnTypeDescriptionPossible valuesExample

result

array of hashes

An array of hashes of function output.

This hash includes the status and statusmsg returns.

 

status

Boolean

Whether the function succeeded.

The function returns this value in the result hash.

  • 1 — Success.
  • 0 — Failure.
1

statusmsg

string

A message of success or a reason for failure.

The function returns this parameter in the  result hash.

  • Successfully set main IP address of the reseller.
  • An error message.

Successfully set main IP address of the reseller.