Need help with liveAPI or similar
Hi
I have bought a reseller account at domain.ca - but not because I want to run a web host site.
I Run a website where the user can store images from survailance cameras. I run something manually at the moment - but I would like to run somethings automatic/dynamically.
Actually all I need is to be able to create the following when I have a new customer (the customer register in Wordpress/woo commerce)
1) create a new sub domain
2) create a ftp account for this sub domain
3) create a cron job.
Maybe I can use LiveAPI? - but I can't figure out how to Instantiate the CPANEL object?
How can I do this?
require_once "/usr/local/cpanel/php/cpanel.php";
And where shall I put the php files to use LiveAPI
Am I way off or is there an easier way?
-
Actually all I need is to be able to create the following when I have a new customer (the customer register in Wordpress/woo commerce) 1) create a new sub domain 2) create a ftp account for this sub domain 3) create a cron job.
Hello, The following API functions are available for these actions: cPanel API 2 Functions - SubDomain::addsubdomain - Software Development Kit - cPanel Documentation UAPI Functions - Ftp::add_ftp - Software Development Kit - cPanel Documentation cPanel API 2 Functions - Cron::add_line - Software Development Kit - cPanel Documentation If you are integrating these functions with a PHP script, you might consider using the PHP client class: GitHub - CpanelInc/xmlapi-php: A PHP Class for Interacting with cPanel's XML-API Thank you.0 -
I have already created a PHP Class to easily use the cPanel/WHM API. you can found it here : - Removed - For example if you want to add a subdomain to an account : cPanelApi('username', 'SubDomain', addsubdomain, ['domain' => 'subdomain', 'rootdomain' => 'domain.com', 'dir' => "/public_html/directory_name" ]);0
Please sign in to leave a comment.
Comments
2 comments