getting 301 redirect when trying to access API

rafiki270

Registered
Mar 31, 2010
1
0
51
Hi,

when I try http://x3demob.cpx3demo.com:2083/json-api/version?user=x3demob&pass=x3demob

which is the official cPanel demo, I am getting 301 redirect to the x3 admin panel. Does anyone know what does it mean?

I've been struggling for three days, trying different connections to different account in three different prog. languages and no result.

If I'll try to connect to the API (cPanel demo or my hosting) I'll get "A connection failure occurred: SSL problem (possibily a bad/expired/self-signed certificate)" message.

And the request I am trying to get is so simple:
https://x3demob.cpx3demo.com:2083/json-api/version
I've even tried:
https://x3demob.cpx3demo.com:2083/json-api/version?user=x3demob&pass=x3demob

Is there any working example how to access the api, I've seen you talking about XMLAPI php class but I've been unable to find it ...

Please help :) ... I am quite desperate already :)

Thanks,

Ondrej
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
After authenticating (logging-in) please try the following JSON-API and XML-API examples that are based off of our documentation (using WHM):
Code:
http://server:2086/json-api/version
https://server:2087/json-api/version
http://server:2086/xml-api/version
https://server:2087/xml-api/version
Reference: Display cPanel/WHM Version — version

If needing to call cPanel API1 or API2 functions via XML-API or JSON-API, please see the following resource: cPanel XML and JSON APIs — cpanel

Related Documentation:
 

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
Houston, TX
cPanel Access Level
Root Administrator