Skip to main content

Need a basic example of working with cPanel's XML API PHP Class

Comments

1 comment

  • AndrewH.
    include '../xmlapi.php'; // Includes the xml api support $ip = getenv('REMOTE_HOST'); //set IP to whatever your REMOTE_HOST is ... this should be your cpanel server's ip $root_pass = getenv('REMOTE_PASSWORD'); // root password for cpanel server $domain = "somedns.com"; // domain to add $xmlapi = new xmlapi($ip); //creates a new xmlapi call specified to the ip address you gave it $xmlapi->password_auth("root",$root_pass); //sets login info - we have to validate you before we can run api calls $xmlapi->set_http_client('curl'); //??? - same as linux client? someone else might be able to clarify further $xmlapi->set_port(2086); //default WHM non-ssl port $xmlapi->set_debug(1); // i don't know if you need this print $xmlapi->adddns($domain,$ip); //i believe what runs the call
    Additionally here is the documentation link for our API:
    0

Please sign in to leave a comment.