binaer

Well-Known Member
Jul 6, 2004
60
0
156
Hi

For a new Project, I've to list all Domains (inlcuding Main/Parked and Addon Domain) of all Accounts from one Server. How can I get this List using API2? Or is there a way using XML-Api? (API2 preferred).

I know that I can listaccts and then in a while-loop, but is there an easier way, maybe a direct function? Haven't found something about this.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Hi

For a new Project, I've to list all Domains (inlcuding Main/Parked and Addon Domain) of all Accounts from one Server. How can I get this List using API2? Or is there a way using XML-Api? (API2 preferred).

I know that I can listaccts and then in a while-loop, but is there an easier way, maybe a direct function? Haven't found something about this.
Keep in mind, just as cPanel and WHM do different things, so do the XML-API (a WHM API) and API2 (a cPanel API).

You can use the XML-API to list accounts (listaccts), then call API2 via the XML-API to loop through each account and execute these API2 functions for each account:

Park::listparkeddomains
Park::listaddondomains

If you are familiar with API2, you can view this last function in use in /usr/local/cpanel/base/frontend/x3/addon/index.html
 

binaer

Well-Known Member
Jul 6, 2004
60
0
156
Hi

thank's for response.

How should I connect to API2 from outside? Is there any way? I know that this API is inside cPanel, but I need the script to be executed from outside...

I found now this Function:
http://www.cpanel.net/plugins/xmlapi/listzones.html
which helps me... but we've not yet updated our Servers.

Is it possible to become this function without an Update?
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Hi

thank's for response.

How should I connect to API2 from outside? Is there any way? I know that this API is inside cPanel, but I need the script to be executed from outside...
API2 functions can be called from outside scripts via the XML API as documented at:

http://cpanel.net/plugins/xmlapi/cpanel.html

I found now this Function:
http://www.cpanel.net/plugins/xmlapi/listzones.html
which helps me... but we've not yet updated our Servers.

Is it possible to become this function without an Update?
No, that is not possible. Note that 11.24 is currently only in EDGE so this functionality has not yet propagated to production worthy builds such as CURRENT, RELEASE and STABLE.