Automate account creation tasks

Tmike

Member
Jan 21, 2016
6
0
1
Thailand
cPanel Access Level
Root Administrator
Hi,

Currently, for each new domain, this is what i'm doing :

- Create new account
- Edit the dns zone of the domaine to add custom A (ns1.thedomaine.com ns2.thedomaine.com)
- Login to the new created account and create a new Mysql database
- Create an user for this database
- Add the rights for this database to this user

This is what i need to do for each domain and i'm doing this at least 10 times a day.

Is there any ways to automatise all of that ? Maybe create the zones and database for each new account ?

The best will be to import a list of domain and doing all of that in auto.

Any suggestion ?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello :)

Yes, you could develop a script that utilizes our API and then configure it to run automatically after account creation through a hook. The following documents are a good place to start:

Guide to UAPI - Software Development Kit - cPanel Documentation
Guide to Standardized Hooks - Software Development Kit - cPanel Documentation

Note that some API functions are not yet available as UAPI functions. You can use cPanel API 2 in these cases:

cPanel API 2 Functions - ZoneEdit::add_zone_record - Software Development Kit - cPanel Documentation

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
It's woking but i can't get the passed datas, i need the username and password
Could you elaborate on this? For instance, does your custom script authenticate and utilize API functions?

Thank you.