find user's addon domain and subdomain folder path

tecwithquestion

Well-Known Member
Oct 20, 2014
57
1
8
cPanel Access Level
Root Administrator
Hello

Can someone help to find users addon dominn path and subdomain path using cpanel uapi ?

I tried to use documentation link but I am unable to find exact code.

Thank you.
 

SysSachin

Well-Known Member
Aug 23, 2015
604
46
28
India
cPanel Access Level
Root Administrator
Twitter

tecwithquestion

Well-Known Member
Oct 20, 2014
57
1
8
cPanel Access Level
Root Administrator
Thank you !

How can I get result using

<?php

include("/usr/local/cpanel/php/cpanel.php"); // Instantiate the CPANEL object.

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

print $cpanel->header( "Path" ); // Add the header.
$list_addons = $cpanel->api2(
'AddonDomain', 'listaddondomains',
array(
'dir' => 'domain',
)
);
echo $list_addons ;
<?php

print $cpanel->footer(); // Add the footer.

$cpanel->end(); // Disconnect from cPanel - only do this once.

?>

IS this the correct way to use code?

Please correct me if I am wong
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter