mgufrone / cpanel-php

CPanel/WHM API for PHP
MIT License
158 stars 91 forks source link

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

Open josenobile opened 7 years ago

josenobile commented 7 years ago

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 7 years ago

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 6 years ago

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