Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Automate account creation tasks

Discussion in 'cPanel Developers' started by Tmike, Jan 21, 2016.

  1. Tmike

    Tmike Member

    Joined:
    Jan 21, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,957
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Tmike

    Tmike Member

    Joined:
    Jan 21, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    Already coded and working :) Thank you
     
  4. Tmike

    Tmike Member

    Joined:
    Jan 21, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    Seems that we can't copy files from an account to another with the api. What is the hook event for account creation ? i can't find it in the doc...

    Thank you
     
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,957
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Tmike

    Tmike Member

    Joined:
    Jan 21, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    #6 Tmike, Jan 26, 2016
    Last edited by a moderator: Jan 27, 2016
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,957
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Tmike

    Tmike Member

    Joined:
    Jan 21, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
  9. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,957
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Could you elaborate on this? For instance, does your custom script authenticate and utilize API functions?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice