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.

API Calls for Cpanel Interface

Discussion in 'cPanel Developers' started by Gareth-AWD, Jun 22, 2012.

  1. Gareth-AWD

    Gareth-AWD Well-Known Member

    Joined:
    Jul 3, 2008
    Messages:
    144
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    London, UK
    cPanel Access Level:
    Root Administrator
    As my company isn't a hosting company, we don't give cpanel access as it confuses customers.

    However, I want to build a front end system that my customers can login and see their BW etc via my own account system on our website.

    It would be great if Cpanel would support API calls so I can tell how much BW is used for a certain user. The best method would be via JSON.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    There is already a JSON API and an XML-API available for the cPanel interface that only needs cPanel access to access: cPanel & WHM's SDK

    This is a request for existing functionality, so I am going to move this to our Developers forum so you can get help with using this API.
     
  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
    Gareth-AWD,

    The entire cPanel UI is designed with cPanel API1 and API2 calls.

    The Remote API, which supports both XML and JSON responses, is for making API requests of your server, using HTTP(S).

    DavidG is right. You can use the Remote API to communicate with you cPanel servers from your customer portal. The Remote API allows you to proxy cPanel API calls (API1 and API2). When you make this Remote API call the action will be performed as the cPanel user being affected; it's possible to authenticate as that user, or as root or the cPanel user's reseller.

    There are a ton of threads in this forum about using the Remote API (most of which refer to the Remote API as the "XMLAPI" or "XML-API"...don't be deceived, they're talking about the same thing ;) ).

    A lot of folks use the PHP "XMLAPI" Client Class available on our GitHub page (again, it can make a JSON requests too...in particular, the query methods will return the JSON and you'll have to decode it yourself...as opposed to an XML query with this class, which will be transformed into a array for you by the query methods)

    There's also a Perl module for client code written in Perl called cPanel::PublicAPI

    Regards,
    -DavidN
     
  4. Gareth-AWD

    Gareth-AWD Well-Known Member

    Joined:
    Jul 3, 2008
    Messages:
    144
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    London, UK
    cPanel Access Level:
    Root Administrator
    I've been using Cpanel for 4 years and I never knew that. How long has it been available?

    I guess we've never needed to do it before!
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This has been possible since version 11.0, so almost 6 years.
     
Loading...

Share This Page