Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

cPanel Functions — Cpanel

The only Cpanel category event is dynamic. There are main cPanel API calls, all of which are hookable through this pragmatic event schema.

For example, if you wished to hook the StatsBar::stat function of cPanel's API 2, the event name would be Api2::StatsBar::stat.

note Note: This event will be execute by the cPanel user. For Remote API calls that proxy to the cPanel API, and for cPanel API calls performed as a reseller in the cPanel interface, this user will be the one affected by the proxied API call, not the authenticated user.

Api$api_version::$module::$function

Stage: pre — This hookable event is run before a specified API 1 or API 2 call is executed on the system.

Blocking Attribute: No
Escalate Privilege Attribute: Yes
Action Code Runs As: The cPanel user executing the API call.
Data:
{
    'args' => "When using an API 1 call, this parameter contains an array reference whose elements correlate to the call's ordered arguments. "
            . "When using an API 2 call, this parameter contains a hash reference whose key/value pairs correlate to the call's key/value pairs.", 
    'output' => "Variable reference that will likely be overwritten during cPanel & WHM processing; expect an undefined value here.",
    'user' => "cPanel user under which the API call is being performed.",
}


Stage: post — This hookable event is run after a specified API 1 or API 2 call is executed on the system.

Blocking Attribute: No
Escalate Privilege Attribute: Yes
Action Code Runs As: The cPanel user executing the API call.
Data:
{
    'args' => "When using an API 1 call, this parameter contains an array reference whose elements correlate to the call's ordered arguments. "
            . "When using an API 2 call, this parameter contains a hash reference whose key/value pairs correlate to the call's key/value pairs.", 
    'output' => "A string, hash reference, or an array reference of hash references that contain the response from the API call.",
    'user' => "cPanel user under which the API call was performed.",
}

Topic revision: r3 - 12 Mar 2012 - 20:46:24 - Main.JustinSchaefer
SoftwareDevelopmentKit.StdcPanelFunctions moved from Sandbox.StdcPanelFunctions on 12 Mar 2012 - 20:46 by Main.JustinSchaefer - put it back