You can call cPanel API and UAPI functions through the WHM API.
This method is useful, for example, when you develop plugins for WHM users, particularly resellers, but need to access cPanel functions. You can make these calls from within either the WHM or cPanel interfaces.
Important:
We recommend that you use the WHM API 1 uapi_cpanel
function. The uapi_cpanel
function is a more flexible way to call cPanel API functions from WHM. For example, you can use the uapi_cpanel
function with the WHM API 1 batch
function.
Before calling a cPanel API function via this method, read its documentation. The cPanel API function may require other parameters not listed in this document.
whmapi1 --output=jsonpretty \ cpanel \ cpanel_jsonapi_user='user' \ cpanel_jsonapi_module='Email' \ cpanel_jsonapi_func='listpopswithdisk'
{- "data": null,
- "metadata": {
- "command": "cpanel",
- "reason": "OK",
- "result": 1,
- "version": 1
}
}