cpanel-php icon indicating copy to clipboard operation
cpanel-php copied to clipboard

How call WHM API 1? I can call WHM API 0 (Deprecated), UAPI and cPanel API 2, but not WHM API 1

Open josenobile opened this issue 9 years ago • 2 comments

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

josenobile avatar Jan 09 '17 17:01 josenobile

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);

henriqueccruz avatar Jan 14 '17 21:01 henriqueccruz

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>";

ttouf avatar Aug 17 '18 10:08 ttouf