A small, strictly typed PHP 8.2+ client generated from the bundled MXroute OpenAPI 3.0 specification. It uses immutable request/response DTOs, final service classes, PSR-18 HTTP clients, PSR-17 factories, and domain-specific exceptions.
composer require community-sdks/mxroute-phpGuzzle is included and configured internally, so no separate HTTP client setup is required.
use CommunitySDKs\MXRoute\Configuration;
use CommunitySDKs\MXRoute\DTOs\Requests\EmailAccounts\CreateEmailAccountRequest;
use CommunitySDKs\MXRoute\MXRouteClient;
$mxroute = new MXRouteClient(
new Configuration(
apiKey: getenv('MXROUTE_API_KEY'),
server: getenv('MXROUTE_SERVER'),
username: getenv('MXROUTE_USERNAME'),
),
);
$response = $mxroute->emailAccounts()->createEmailAccount(
'example.com',
new CreateEmailAccountRequest(
username: 'hello',
password: 'SecurePassword1',
quota: 1024,
),
);The API URL, request timeout, and user agent are configurable through Configuration. Advanced integrations can still use MXRouteClient::create() with custom PSR-18 and PSR-17 implementations, or inject a TransportInterface directly.
See the documentation index for all 43 operations, grouped into 11 services.
Non-2xx API responses throw ApiException, exposing the HTTP status, API error code, message, and decoded response body. Network failures throw TransportException. Both extend MXRouteException.
composer install
composer test
composer generatecomposer generate rebuilds endpoint services and DTOs from api-1.json.