WHM API: 按域查找 cPanel 用户

WHM API: Find cPanel user by domain

我正在开发 WHM API 并希望通过传递域名来查找 cPanel 用户名。

注意:我有WHM的凭证。

此处不存在此类文档https://documentation.cpanel.net/pages/viewpage.action?pageId=1507786

那么,有没有办法实现呢?

更新:

现在,我正在使用 xmlapi.php,这是我目前尝试过的方法。

    require_once(base_path() . "/vendor/cpanel_api/xmlapi.php");
    $ip = env('SERVER_IP', "127.0.0.1"); //your server's IP

    $xmlapi = new \xmlapi($ip);
    $xmlapi->password_auth(env('CPANEL_USER', "root"),env('CPANEL_PASSWORD', "")); //the server login info for the user you want to create the emails under

    $xmlapi->set_output('json');
    $xmlapi->set_debug(1);

    $params = array('domain'=>$domain, 'searchtype'=>'domain'); //quota is in MB
    $res = json_decode($xmlapi->api2_query('root', "listaccts", "", $params), true);


    print_r($res);

$xmlapi->api2_query方法中,有4个参数

我必须找出 cPanel 用户名,所以,我暂时写了 'root'。但没有成功

请尝试使用 cPanel API。

这是 API 的一些有用文档。

https://documentation.cpanel.net/display/SDK/Guide+to+cPanel+API+2 https://documentation.cpanel.net/display/SDK/Guide+to+WHM+API+1