Introduction
You can call cPanel API and UAPI functions through the WHM API.
Note:
We introduced this feature in cPanel & WHM version 11.48.
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.
Basic usage
WHM API calls consist of the following basic parts:
Item
|
Description
|
Example
|
Server
|
The web server's HTTP address.
Generally, this value is https:// and the hostname.
|
https://hostname.example.com
|
Port
|
The port number to access.
Notes:
|
2087
|
Security Token
|
The current session's security token.
|
cpsess123456789
|
Output format
|
The output type to return.
Note:
This API's XML output does not comply with XML standards, is slower than JSON output to produce, and may result in validation errors. Westrongly recommend that you use JSON.
|
json-api
|
Function
|
The WHM API function to call. For cPanel API1, cPanel API2, and UAPI, use the cpanel function.
|
cpanel
|
cPanel User
|
The cPanel username for the account through which to call the function.
|
cpanel_jsonapi_user=user
or
cpanel_xmlapi_user=user
|
cPanel API or UAPIModule
|
The UAPI module name.
Important:
Module names are case-sensitive.
|
cpanel_jsonapi_module=Email
or
cpanel_xmlapi_module=Email
|
cPanel API or UAPI Function
|
The UAPI function name.
Important:
Function names are case-sensitive.
|
cpanel_jsonapi_func=listpopswithdisk
or
cpanel_xmlapi_func=listpopswithdisk
|
cPanel API Version
|
The cPanel API version to use.
Warning:
If you do not supply this parameter, the system defaults to cPanel API 2.
|
cpanel_jsonapi_apiversion=3
or
cpanel_xmlapi_version=3
|
Variable Names and Values
|
The function's input parameters and their values.
Notes:
|
domain=example.com
|