The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    1
    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,557
    Likes Received:
    7
    Trophy Points:
    38
    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:
     
  3. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page