Description
The api()
method executes a cPanel API 1 or cPanel API 2 function.
Important:
We strongly recommend that you use the appropriate method for the chosen API (api1()
or api2()
), rather than this method. These API-specific methods use additional internal logic to integrate with cPanel & WHM.
Example
LiveAPI PHP Class
1
2
3
4
5
6
7
8
9
|
// Execute the Email::listpopswithdisk function. $cpanel ->api( 'exec' , '2' , 'Email' , 'listpopswithdisk' , array ( 'domain' => 'example.com' , 'nearquotaonly' => '0' , 'no_validate' => '0' , ) ); |
LiveAPI Perl Modul e
1
2
3
4
5
6
7
8
9
10
11
|
# Execute the Email::listpopswithdisk function. $cpliveapi ->api( 'exec' , '2' , 'Email' , 'listpopswithdisk' , { 'domain' => 'example.com' , 'api2_filter' => '1' , 'api2_filter_column' => 'diskquota' , 'api2_filter_term' => '350' , 'api2_filter_type' => 'lt_handle_unlimited' , } ); |
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
type |
string |
The request type. |
exec |
exec |
version |
integer |
The cPanel API version. |
|
2 |
module |
string |
The module name. |
A cPanel API 1 or cPanel API 2 module name. |
|
func |
string |
The function name. |
A cPanel API 1 or cPanel API 2 function name. |
listpopswithdisk |
arguments |
array or hash |
The function's input parameters and values. |
|
Returns
This method returns a hash reference of the function's output.