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

 

Description

This function retrieves the IP address that an account shares with the accounts that it owns.

Examples


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


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.1"
   },
   "metadata":{  
      "reason":"OK",
      "command":"get_shared_ip",
      "result":1,
      "version":1
   }
}
 Output (XML)
<result>
    <data>
        <ip>192.168.0.1</ip>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>get_shared_ip</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

The WHM user's username.

This parameter defaults to the currently-authenticated user.

A valid WHM username on the server.example

 

Returns

ReturnTypeDescriptionPossible valuesExample
ipstring

The IP address that the WHM user shares.

Note:

If the user does not have a shared IP address, the function returns the tilde ( ~ ) character.

A valid IP address.
192.168.0.1