Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    1

    Default XML API 2 help

    What is wrong here? Thanks in advance

    Code:
    <?php
    require_once('xmlapi.php'); 
    
    $ip = 'www.mydomain.com';
    $account = 'cp_user';
    $pass = 'cp_password';
    
    $xmlapi = new xmlapi($ip);
    $xmlapi->password_auth($account,$pass);
    $xmlapi->set_output("json");
    
    $xmlapi->set_debug(1);
    print $xmlapi->api2_query($account, 'SubDomain','addsubdomain', array('dir'=>'/public_html/subdomain/','disallowdot'=>1,'domain'=>'subdomain','rootdomain'=>'www.mydomain.com'));
    ?>

  2. #2
    cPanel Staff cPanelMatt's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default Re: XML API 2 help

    If you are using a user's credentials and not root, you need to do an $xmlapi->set_port(2083); before you attempt the query.
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

Similar Threads & Tags
Similar threads

  1. xml-api/accountsummary
    By monaghan in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 06-25-2008, 03:57 PM
  2. xml-api reseller
    By eugui in forum cPanel Developers
    Replies: 1
    Last Post: 05-22-2008, 11:05 PM
  3. XML-API is any of these possible?
    By neo4242002 in forum cPanel Developers
    Replies: 3
    Last Post: 03-17-2008, 01:46 PM
  4. XML API: always get login screen, not XML
    By sldff3ald in forum cPanel Developers
    Replies: 3
    Last Post: 09-19-2007, 09:29 AM
  5. How do I use the xml - api?
    By rhopperger in forum cPanel Developers
    Replies: 3
    Last Post: 05-19-2007, 08:07 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube