Can I create an page where I can create / add / delete / modify emails and databases?

gaurav_ch

Registered
Jun 7, 2011
2
0
51
Hi,

I am new to cpanel development and this is the first time I am posting here.

I want to create a simple page (php or using json) which will have an option to create / add / delete / modify emails and databases. Actually I have a shared hosting from justhost and my wife manages all the emails and databases for me as I keep busy with coding :D but cpanel is proving to be a little overwhelming for her.

So, I was thinking whether I can create a page where she can manage the db and emails easily.

Can this be done without actually logging into cpanel? I am new to cpanel so please excuse my stupid question.

I went through the api docs but got confused as I could not figure where to start actually.:confused:

Any help will be appreciated.

Thanks in advance.

Gaurav
 

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
Houston, TX
cPanel Access Level
Root Administrator
Re: Can I create an page where I can create / add / delete / modify emails and databa

Hi Gaurav,

Welcome to the Developer Discussions Forum!

The answer to your question, in short, is "yes".

First thing I would suggest would be to troll through the Integration Blog, in particular there's a a little primary on the cPanel API. Hopefully, that article will begin to clarify some of the more confusing bits of our documentation.

You'll probably end up using the XML/JSON-API. This is used for remote calls, ie any API call that is not processed within a cPanel runtime process. So, if you wanted to make a website (served from you public_html directory) that does all this recourse manipulation, since it is served by Apache and not the cPanel engine, you would make your API calls via XML-API or JSON-API. Same thing would apply if you made a local website on your PC or a CLI application.

And actually, since you're performing cPanel actions (and not WHM), you will only be using the XML/JSON-API as an remote interface to the cPanel APIs (API1 and API2). Those details are documented here.

If you're coding in PHP there are two ready-made clients for interacting with cPanel. The PHP XML-API client class is a simple, single class that can utilize the XML or JSON remote interfaces. The PHP PublicAPI client class is a more sophisicated client (that relies on a library of other classes) that is more targeted to application and framework deployment. But despite this, it's rather fast and simple to use.

Using one of these client classes can greatly decrease the learning curve related to working with cPanel APIs. If you decide to not do in in PHP, there's a Perl variant of the PublicAPI client call cPanel::PublicAPI (also available on CPAN). Currently, those are the only languages that we have remote clients for.

As you become more familiar with the cPanel APIs, I'm sure you'll have more questions. Hopefully, there will already be a thread or article that addresses your dilemma, but if not, just ask and we'll be happy to get you moving in the right direction again!

Best Regards,
-DavidN
 

gaurav_ch

Registered
Jun 7, 2011
2
0
51
Re: Can I create an page where I can create / add / delete / modify emails and databa

Thanks, David. I am really grateful for your reply. The information you provided is great for me to get started.

Thanks again.:)

Gaurav