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.

XML API enabled in my account

Discussion in 'cPanel Developers' started by bwor, Jun 13, 2010.

  1. bwor

    bwor Member

    Joined:
    Jun 15, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    How I know XML API is enabled in my account and not disabled in the hosting server.
     
  2. 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
    The XML-API cannot be turned off. Your hosting company would have to go to great lengths to block it. The only other possibility is that they remove the binary itself.

    After authenticating into cPanel in a browser, try this URL in you browser
    Code:
    //$server = your server
    
    http://$server:2082/xml-api/applist
    
    This is a generic function that will tell you which XML-API functions you can execute with your account. It's not always inclusive, but it should be pretty close. If you get back ANY XML content, the your hosting server has the XML-API binary installed and working normally.

    Regards,
    -DavidN
     
  3. bwor

    bwor Member

    Joined:
    Jun 15, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    I type the url http://$server:2082/xml-api/applist after I login to cpanel but I get this HTTP 404 Not Found or The webpage cannot be found.

    My hosting server is https not http therefore I use the port is 2083
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,468
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Either should work. But not with cPanel ports, try a WHM port (after logging into WHM) instead.

    /https://server.name.com:2087/xml-api/applist

    Or if you have security tokens enabled:

    /https://server.name.com:2087/cpsesssomelongumberhere/xml-api/applist

    Those both work for me.
     
  5. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    The only call that should work via port 2083 is the cpanel call.

    e.g.

    :2083/xml-api/cpanel?cpanel_xmlapi_module=Email&cpanel_xmlapi_func=listpopswithdisk
     
  6. bwor

    bwor Member

    Joined:
    Jun 15, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    I get this result when I type previous link
    PHP:
     <cpanelresult>
      <
    apiversion>2</apiversion
      <
    error>Could not find function '' in module 'Email'</error
      <
    func /> 
      <
    module>Email</module
      </
    cpanelresult>
    What that meaning ?
     
  7. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,468
    Likes Received:
    196
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    The problem with this one is not the URL, but the forums here breaking it as he has it posted.

    Look close at the last part of it:
    xmlapi_fu nc=listpopswithdisk

    See the break in fu nc remove that space and it should work fine. ;)
     
Loading...

Share This Page