How call WHM API 1? I can call WHM API 0 (Deprecated), UAPI and cPanel API 2, but not WHM API 1
Opened this issue · 2 comments
josenobile commented
Hello,
How call WHM API 1? I can call WHM API 0 (Deprecated), UAPI and cPanel API 2, but not WHM API 1. How to call it? https://documentation.cpanel.net/display/SDK/Guide+to+WHM+API+1
henriqueccruz commented
It's simple, really.
All you have to do is define api.version inside arguments.
Example:
$arguments = array('api.version' => '1'); $mail_queue = $cpanel->fetch_mail_queue($arguments);
ttouf commented
to use API 1 with more parameters use this:
backup user account sample:
$accounts_json = $cpanel->start_background_pkgacct(["api.version" => 1, "user" => "username"]); $accounts = json_decode($accounts_json, true); echo "<pre>"; print_r($accounts); echo "</pre>";