Results 1 to 2 of 2

Thread: XMLAPI Class on Git Hub

  1. #1
    Member
    Join Date
    Jun 2011
    Posts
    15

    Exclamation XMLAPI Class on Git Hub

    Hey

    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

    Thanks!
    Ricky

  2. #2
    Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default Re: XMLAPI Class on Git Hub

    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:

    PHP Code:
    <?php

    include("../xmlapi.php");

    $account "someuser";
    $email_account "randomemail";
    $email_domain "somedomain.com";

    $xmlapi = new xmlapi($ip$account$password);
    $xmlapi->set_port(2083);

    print 
    $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 sdk.cpanel.net
    Matt Dees

Similar Threads

  1. Problems Installing GIT
    By Jason Brice in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 02-09-2011, 01:38 PM
  2. Strange behavior of Mysql::adddb (XMLAPI php class)
    By finitor in forum cPanel Developers
    Replies: 3
    Last Post: 05-31-2010, 04:11 AM
  3. GIT + Redmine + CPanel = Possible? or no...
    By damainman in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 05-06-2010, 04:43 PM
  4. XMLAPI php class
    By MattDees in forum cPanel Developers
    Replies: 108
    Last Post: 10-30-2009, 09:11 AM
  5. Hub
    By aryapsh in forum New User Questions
    Replies: 0
    Last Post: 06-02-2007, 06:01 AM

Tags for this Thread