Self-contained client in PHP for simplifying access to the Maxemail API
This package requires at least PHP 7.1 . Please see previous releases if you require compatibility with an older version of PHP.
Composer will verify any other environment requirements on install/update.
When creating a new major version of this package, we MAY drop support for PHP versions which are no longer actively supported by the PHP project.
Including this package in your application is made easy by using Composer.
$ composer require maxemail/api-php
// Instantiate Client:
$config = [
'username' => '[email protected]',
'password' => 'apipass'
];
$api = new \Maxemail\Api\Client($config);
// General:
$result = $api->serviceName->method($arg1, $arg2);
var_dump($result);
If you want more useful development-time debug info, throw the API a PSR-compatible logger:
$logger = new Logger(); // Must implement \Psr\Log\LoggerInterface
$api->setLogger($logger);
For a quick-start to logging (plus advanced multi-destination logging!), see Phlib/Logger
The client also includes a Helper class to take care of common scenarios that are more complicated than the simple request-response model.
The helper is accessed from the client by the getHelper()
method:
$api->getHelper()->downloadFile(...);
See the in-line documentation for helper methods for the required and optional parameters.
This package is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.