zimbra-api/soap-api

PHP wrapper library around the Zimbra Soap API

3.0.3 2024-04-23 08:32 UTC

README

This library is a simple Object Oriented wrapper for the Zimbra SOAP API.

Requirement

  • PHP 8.1.x or later,
  • PSR Discovery library for searching installed http clients and http message factories,
  • Serializer library for (de-)serializing XML,
  • (optional) PHPUnit to run tests,

Installation

Via Composer

$ composer require zimbra-api/soap-api

or just add it to your composer.json file directly.

{
    "require": {
        "zimbra-api/soap-api": "*"
    }
}

Basic usage of admin api

<?php declare(strict_types=1);

require_once 'vendor/autoload.php';

use Zimbra\Admin\AdminApi;
use 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));

From $api object, you can access to all Zimbra Admin API.

Licensing

BSD 3-Clause

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.