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!

XML API class works with a WHM cPanel reseller account?

Discussion in 'cPanel Developers' started by bcosmo, Mar 16, 2010.

  1. bcosmo

    bcosmo Registered

    Mar 16, 2010
    Likes Received:
    Trophy Points:
    Hello my friends!

    I'm try to use the XML API class 1.0 to create accounts at my WHM cPanel reseller account. (createacct_example.php).

    $ip "";
    $root_pass "pass";

    $xmlapi = new xmlapi($ip);


    $acct = array( plan => "plan_plus"username => "band"password => "test123"domain => ""contactemail => "");
    But nothing happens, return a blank screen! maybe because my account is a Reseller type not a VPS Server or Dedicated Server.

    Other example (api2_example.php)


    $ip "";
    $root_pass "pass";

    $account "";

    $xmlapi = new xmlapi($ip);


    $xmlapi->api2_query($account"Email""listpopswithdisk" );
    Return nothing:

    {"data":{"reason":"Access denied","result":"0"},"type":"text"} 
    My Cpanel WHM version is:

    cPanel 11.25.0-S43473 - WHM 11.25.0 - X 3.9
    CENTOS 5.4 i686 virtuozzo on sv1021

  2. cPanelDavidN

    cPanelDavidN Well-Known Member Staff Member

    Dec 17, 2009
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    xml-api with reseller credentials

    Hi bcosmo,

    First issue:

    If your Reseller account has been given permission to create accounts, then the xmlapi call should work. Have you tried it without specifying a plan/package? Your reseller account many be restricted on packages too. I'm really surprised you got ..nothing... You should have, at minimum a pair of curly braces and an empty data key (for JSON) or an empty root node (for XML).

    Have you tried the same call, but specifying xml output instead?
    I know that's not what you desire, but it should return the same response, only formatted differently. If it doesn't it could be a tell-tale sign of a bug (though I just tried in on working servers *shrug*)

    I don't see any reason that hardware allocation would have any bearing on you Reseller access. Some hosting software, for their corresponding user type, is affected by this; to my knowledge cPanel/WHM is not affected by hardware allocation (for the purposes of this conversation, ie account privileges).

    Second issue:

    I'm not sure, I fully understand what you're trying to accomplish.

    My assumption is that you have '' and ''; you wish to view all the emails that belong specifically to ''

    If that's the case, you should pass 'domain' as the cpuser and provide the "domain" variable to the api2 arguments:
    $account = 'dave'; //this is the user for ""
    $result = $xmlapi->api2_query($account, "Email", "listpopswithdisk",
    // Will yeild just the email addresses and disk
    //  usage for my "lildave" subdomain, ie.
    //, but not 
    Hope this helps,
    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