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!

XMLAPI Class on Git Hub

Discussion in 'cPanel Developers' started by rmatakajr, Jul 26, 2011.

  1. rmatakajr

    rmatakajr Member

    Jun 8, 2011
    Likes Received:
    Trophy Points:

    Im just starting to use the XMLAPI class on GitHub. Now I previoulsy wrote a
    class that would screen scrape, add domains, delete domains etc... This worked
    very well untill today where I got a

    The server was not able to find the document (./sql/addb.html) you requested.
    Please check the url and try again. You might also want to report this
    error to your web hosting provider.

    Well this was very sudden :( I was using multiple fsockopen calls to accomplish these
    cpanel tasks.

    Well i figured now is the time to switch to the XMLAPI .. but im very new to it and
    the issiue is i have over 400 users of a software right now that cant do anything :(
    because of this issue (cry)

    So I need to accomplish simple things like. Create a database, crate an addon domain
    etc... and I got to do this rather fast. So my big question is can I use the GitHub XMLAPI class
    to authenticate a users cpanel with there cpanel username and password then
    call these functions to add a domain a database, user etc..

    Any advise would be very awesome im in a bind here

  2. MattDees

    MattDees Well-Known Member

    Apr 29, 2005
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You can query a user's cPanel account via the xml-api PHP class.

    This is done by setting the port to 2083 and making API1/API2 calls:



    $account "someuser";
    $email_account "randomemail";
    $email_domain "";

    $xmlapi = new xmlapi($ip$account$password);

    $xmlapi->api2_query($account"Email""getdiskusage", array(domain=>$email_domainlogin=>$email_account) );
    For references of all the available api calls, please see the Api introduction on
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

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