Accessing cPanel XML API from a client computer

k_shehadeh

Member
Mar 27, 2009
11
0
51
Looking over the cPanel XML API here:
http://www.cpanel.net/plugins/xmlapi/cpanel.html

It's not entirely clear to me if the API can be accessed from a client machine (not a script on the server). I guess what I'm asking is if there are imposed security limitations that make it impossible to accesss the API from a machine other than the one that cPanel is running.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Looking over the cPanel XML API here:
http://www.cpanel.net/plugins/xmlapi/cpanel.html

It's not entirely clear to me if the API can be accessed from a client machine (not a script on the server). I guess what I'm asking is if there are imposed security limitations that make it impossible to accesss the API from a machine other than the one that cPanel is running.
As long as you authenticate successfully, the API can be used from any remote machine.
 

k_shehadeh

Member
Mar 27, 2009
11
0
51
Can authentication be from a non-root user? That is, the owner of the hosting account? And, more generally, I can't seem to find the documentation for the different forms of authentication along with detail about each. That would help a great deal.

Thanks!
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Can authentication be from a non-root user? That is, the owner of the hosting account? And, more generally, I can't seem to find the documentation for the different forms of authentication along with detail about each. That would help a great deal.

Thanks!
Yes, authentication to the XML API being accessed over the WHM ports (2086 and 2087) can be resellers and root users. If you want to authenticate as a hosting account, use the cPanel ports (2082 and 2083). For hosting accounts, you would just use standard HTTP authentication using their username and password to perform the authentication.

If you are not familiar with doing HTTP authentication yourself, there are several samples around the forums but you may wish to consider using a PHP class my colleague, Matt, made for interfacing with our XML API: http://forums.cpanel.net/showthread.php?t=111897