Need suggestion for how to interface with APIs for email functions

scallas

Registered
Mar 19, 2012
2
0
51
cPanel Access Level
Root Administrator
Hello,

I'm a php developer that is new to working with cPanel's APIs. I am looking to create a plugin for a CMS system that enables logged in users to make changes to their email accounts. Specifically, I want users to be able to add and delete email accounts and change passwords on those email accounts. I need to be able to list the email accounts in the management page in the CMS.

Can anyone recommend the best way to interface with the API's to accomplish those items (xmlapi.php, PublicAPI, via url in php script, something else ....)? And, is there a "quick start" guide to show one how to use it? (Thus far, all the documentation that I have seen hasn't helped in showing the first few steps to getting a script running for a first timer, though they seem excellent in providing info for the experienced user.)

Thanks!
 

BlaineM.

cPanel QA Analyst
Apr 4, 2011
31
0
56
Houston, TX
cPanel Access Level
Root Administrator
Greetings,

My suggestion would be to use the cPanel XMLAPI.php class, since it essentially does all of the backend work for you. The php class, plus an examples folder, are located at our Github page

Also, our documentation about the API usage through API isn't exactly a quick start guide, but it does explain a few details you wouldn't normally find elsewhere.

I think if you modify the examples at our Github account, using the knowledge from our documentation, you should be set.
 

scallas

Registered
Mar 19, 2012
2
0
51
cPanel Access Level
Root Administrator
Thank you! That does help. For some reason I couldn't actually find the xmlapi.php download, and yet saw lots of posts about using it - often with dead links to the xmlapi.php class.

Seeing the examples gets me a long way down the road, too!

Cheers,
Scallas