Hey guys,
I'm using the cpanel xmlapi to automatically setup addon domains and l was wondering how l could use the cpanel api key to authenticate instead of the root username/password for the server.
Here's the current code l'm using:
Any help would be greatly appreciated!
I'm using the cpanel xmlapi to automatically setup addon domains and l was wondering how l could use the cpanel api key to authenticate instead of the root username/password for the server.
Here's the current code l'm using:
PHP:
<?php
$subdomain = 'addondomain.com';
$username = 'myusername';
$password = 'mypassword';
require_once('xmlapi.php');
$xmlapi = new xmlapi('184.154.XXX.138');
$xmlapi->password_auth("root", 'ROOT_PASSWORD');
$r = $xmlapi->api2_query($username, "AddonDomain", "addaddondomain", array(subdomain => $subdomain, newdomain => $subdomain, dir => $subdomain, pass => $password));
echo '<pre>';
print_r($r);
?>