|
|||
|
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: Creating Reseller Accounts using PHP? WHM Interface class cPanel URL Login |
|
||||
|
Quote:
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?
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit Last edited by cPanelDavidG; 09-18-2007 at 09:27 AM. Reason: Disabled Smilies |
|
|||
|
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. |
|
||||
|
Quote:
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.
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit |
![]() |
| Thread Tools | |
| Display Modes | |
|
|