Maxemail API Client for PHP
, (*1)
Self-contained client in PHP for simplifying access to the Maxemail API, (*2)
Requirements
, (*3)
This package requires at least PHP 8.1 . Please see previous releases if you
require compatibility with an older version of PHP., (*4)
Composer will verify any other environment requirements on install/update., (*5)
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., (*6)
Installation
Including this package in your application is made easy by using
Composer., (*7)
$ composer require maxemail/api-php
Usage Example
// Instantiate Client:
$config = [
'token' => 'apitoken',
];
$api = new \Maxemail\Api\Client($config);
// General:
$result = $api->serviceName->method($arg1, $arg2);
var_dump($result);
Logging
If you want more useful development-time debug info, throw the API a PSR-compatible logger:, (*8)
$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, (*9)
Helpers
The client also includes a Helper class to take care of common scenarios that
are more complicated than the simple request-response model., (*10)
The helper is accessed from the client by the getHelper()
method:, (*11)
$api->getHelper()->downloadFile(...);
See the in-line documentation for helper methods for the required and optional
parameters., (*12)
License
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., (*13)
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., (*14)
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/., (*15)