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!

getting 301 redirect when trying to access API

Discussion in 'cPanel Developers' started by rafiki270, Mar 31, 2010.

  1. rafiki270

    rafiki270 Registered

    Joined:
    Mar 31, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    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
     
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,554
    Likes Received:
    9
    Trophy Points:
    168
    Location:
    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:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelDavidN

    cPanelDavidN Integration Developer

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    3
    Trophy Points:
    68
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

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