You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

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

Description

This function returns a list of addon domains that belong to the current user.

Important:

In cPanel & WHM version 76 and later, when you disable the Web Server role, the system disables this function.

Examples 



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


Notes:

  • Unless otherwise noted, 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)
{  
   "metadata":{  
      "version":1,
      "command":"convert_addon_list_addon_domains",
      "result":1,
      "reason":"OK"
   },
   "data":{  
      "example.com":{  
         "domain_type":"addon",
         "docroot":"/home/exampleparent/public_html/example.com",
         "subdomain":"example.exampleparent.tld",
         "ip":"192.0.2.0",
         "owner":"exampleparent",
         "reseller":"exampleparent",
         "ipv6":"2001:db8:a0b:12f0::1"
      }
   }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <result>1</result>
        <command>convert_addon_list_addon_domains</command>
        <reason>OK</reason>
    </metadata>
    <data>
        <example.tld>
            <subdomain>example.exampleparent.com</subdomain>
            <docroot>/home/exampleparent/public_html/example.com</docroot>
            <reseller>exampleparent</reseller>
            <ipv6>2001:db8:a0b:12f0::1</ipv6>
            <domain_type>addon</domain_type>
            <ip>192.0.2.0</ip>
            <owner>exampleparent</owner>
        </example.tld>
    </data>
</result>


Note:

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

Parameters

This function does not accept parameters.

Returns

Return

TypeDescriptionPossible valuesExample

domain_name

hash

A hash of the domain's data.

Note:

The domain's name is the return's name.

This hash includes the subdomain, docroot, reseller, ipv6, domain_type, ip, and owner returns.


subdomain

string

The domain's subdomain.

The function returns this value in the domain_name hash.

A valid string.

example.exampleparent.com

docroot

string

The document root for the addon domain.

The function returns this value in the domain _name hash.

An absolute file path.

/home/exampleparent/public_html/example.com

reseller

string

The domain's reseller.

The function returns this value in the domain _name hash.

A valid string.exampleparent

ipv6

string

The domain's IPv6 address.

The function returns this value in the domain _name hash.

A valid IPv6 address. 2001:db8:a0b:12f0::1

domain_type

string

The domain's type.

The function returns this value in the domain _name hash.

A valid string.addon

ip

integer

The domain's IPv4 address.

The function returns this value in the domain _name hash.

A valid IPv4 address. 192.0.2.0

owner

string

The domain's owner.

The function returns this value in the domain _name hash.

A valid string. exampleparent