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!

API2 and JSON

Discussion in 'cPanel Developers' started by mpuk, Apr 11, 2011.

  1. mpuk

    mpuk Registered

    Joined:
    Apr 11, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    51
    Hi All,

    I am looking at the cPanel API for use within a mobile app and I was just wondering if JSON can be used with the API2 functions?

    XML and JSON APIs

    I'm just a bit confused as the functions/examples listed on the link above doesn't include the API2 functions.
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    3
    Trophy Points:
    68
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi mpuk,

    Yes, you can. To make API2 calls remotely, you need to invoke them using the XML-API...I know, the name has "XML" but a JSON format is available from this binary API interface. You might want to read a recent blog article that introduces the various APIs here, Introduction to cPanel & WHM APIs - cPanel Integration.

    Anyway, here's an example URL to POST or GET against the XML-API binary, which returns a JSON formatted response. This particular call is for Email::listpopswithdisk against the cPanel user "dave" and his domain "daves.com".
    Code:
    URL: https://10.1.4.141:2083/json-api/cpanel?domain=daves.com&cpanel_jsonapi_user=dave&cpanel_jsonapi_module=Email&cpanel_jsonapi_func=listpopswithdisk&cpanel_jsonapi_apiversion=2
    
    Let me know if you need more clarification.

    Regards,
    -DavidN
     
    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