public function execute_action($api, $module, $function, $username, $params = array())
    {
        $action = 'cpanel';
        $params = array_merge($params, [
            'cpanel_jsonapi_apiversion' => $api,
            'cpanel_jsonapi_module' => $module,
            'cpanel_jsonapi_func' => $function,
            'cpanel_jsonapi_user' => $username,
        ]);
        $response = $this->runQuery($action, $params);

        return $response;
    }
public function execute_action($api, $module, $function, $username, $params = array())
    {
        $action = 'cpanel';
        $params = array_merge($params, [
            'cpanel_jsonapi_apiversion' => $api,
            'cpanel_jsonapi_module' => $module,
            'cpanel_jsonapi_func' => $function,
            'cpanel_jsonapi_user' => $username,
        ]);
        $response = $this->runQuery($action, $params);

        return $response;
    }
public function execute_action ( $ api , $ module , $ function , $ username , $ params = array ( ) ) { $ action = 'cpanel' ; $ params = array_merge ( $ params , [ 'cpanel_jsonapi_apiversion' => $ api , 'cpanel_jsonapi_module' => $ module , 'cpanel_jsonapi_func' => $ function , 'cpanel_jsonapi_user' => $ username , ] ) ; $ response = $ this -> runQuery ( $ action , $ params ) ; return $ response ; }
Use cPanel API 1 or use cPanel API 2 or use UAPI.

@param $api (1 = cPanel API 1, 2 = cPanel API 2, 3 = UAPI)
@param $module
@param $function
@param $username
@param array $params
@return mixed
@throws \Exception
Use cPanel API 1 or use cPanel API 2 or use UAPI .