PHP code example of zimbra-api / soap-api

1. Go to this page and download the library: Download zimbra-api/soap-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zimbra-api / soap-api example snippets


 declare(strict_types=1);

 Zimbra\Common\Enum\AccountBy;
use Zimbra\Common\Struct\AccountSelector;

$api = new AdminApi('https://zimbra.server:7071/service/admin/soap');
$api->auth($username, $password);
$account = $api->getAccountInfo(new AccountSelector(AccountBy::NAME, $accountName));