Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    2

    Default XML API: always get login screen, not XML

    I'm trying to use the XML API with cPanel 11 (xml-api/applist). I believe I've tried every permutation of hostname/IP, port, and protocol and I either get internal server errors or a login page, but no XML. My shared host didn't have a clue. I'm trying to test this out on my shared host for deployment by someone else, but this should work if they have cPanel 11, right? Is there something my host would have to do to enable the XML API? Is there a tried-and-true way to determine the correct URL to use?

    The methods I tried are the ones given here:

    http://forums.cpanel.net/showthread.php?t=70555
    http://forums.cpanel.net/showthread.php?t=70344
    http://forums.cpanel.net/showthread.php?t=71146

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,720
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by sldff3ald View Post
    I'm trying to use the XML API with cPanel 11 (xml-api/applist). I believe I've tried every permutation of hostname/IP, port, and protocol and I either get internal server errors or a login page, but no XML. My shared host didn't have a clue. I'm trying to test this out on my shared host for deployment by someone else, but this should work if they have cPanel 11, right? Is there something my host would have to do to enable the XML API? Is there a tried-and-true way to determine the correct URL to use?

    The methods I tried are the ones given here:

    http://forums.cpanel.net/showthread.php?t=70555
    http://forums.cpanel.net/showthread.php?t=70344
    http://forums.cpanel.net/showthread.php?t=71146
    First, you must have a reseller account to use the XML-API and the server must be running cPanel 11 (not 10).

    The login screen is typically the result of failed authentication. This could be anything from not encoding user/pass in the sending headers, using the improper user/pass in https://user:pass@...:2087/xml-api/applist and so forth.

    Perhaps post some sample code so everyone here can analyze what may be going wrong?
    Last edited by cPanelDavidG; 09-18-2007 at 09:27 AM. Reason: Disabled Smilies

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    2

    Default Works now. Kinda

    I've now moved the code to another server, and it sort of works. I'm using the Curl method, and /xml-api/applist, /xml-api/gethostname, and /xml-api/version all work (the last returns 11.11.0)

    However, other commands simply return nothing: /xml-api/listresellers (I don't know if there are any resellers however), /xml-api/createacct, and /xml-api/listaccts.

    It would be nice if the API would return some sort of error string, or if that were available somewhere.

    Is there a way to turn on debugging output to either be returned as XML or to be written to a log file?

    And, how do I list all the accounts using listaccts? /xml-api/listaccts?searchtype=user&search=* and with "searchtype=domain&search=*" didn't work.

  4. #4
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,720
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by sldff3ald View Post
    I've now moved the code to another server, and it sort of works. I'm using the Curl method, and /xml-api/applist, /xml-api/gethostname, and /xml-api/version all work (the last returns 11.11.0)

    However, other commands simply return nothing: /xml-api/listresellers (I don't know if there are any resellers however), /xml-api/createacct, and /xml-api/listaccts.

    It would be nice if the API would return some sort of error string, or if that were available somewhere.

    Is there a way to turn on debugging output to either be returned as XML or to be written to a log file?

    And, how do I list all the accounts using listaccts? /xml-api/listaccts?searchtype=user&search=* and with "searchtype=domain&search=*" didn't work.
    For a list of common issues encountered while using the XML-API and what they mean, refer to this post.

    The API usually does return an error string in XML format should errors be encountered in your query. You may want to check the raw text that is being returned and compare it to the items I listed on that other post to see what may be going on.

    Also, to list all users, use:

    https://spacetime.cpanel.net:2087/xm...earchtype=user

    Note that * is typically not used in a Unix environment in the same way as it is in a Windows environment, so * usually means the literal string * rather than a wildcard character.

Similar Threads & Tags
Similar threads

  1. PHP XML API - output in error log but not on screen!
    By benwiggy in forum cPanel Developers
    Replies: 2
    Last Post: 05-28-2011, 12:23 PM
  2. XML API 2 help
    By Dragonxito in forum cPanel Developers
    Replies: 1
    Last Post: 05-13-2011, 05:23 PM
  3. XML-API is any of these possible?
    By neo4242002 in forum cPanel Developers
    Replies: 3
    Last Post: 03-17-2008, 02:46 PM
  4. How do I use the xml - api?
    By rhopperger in forum cPanel Developers
    Replies: 3
    Last Post: 05-19-2007, 09:07 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube