Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MXroute PHP SDK

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.

Installation

composer require community-sdks/mxroute-php

Guzzle is included and configured internally, so no separate HTTP client setup is required.

Quick start

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.

Services

See the documentation index for all 43 operations, grouped into 11 services.

Error handling

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.

Development

composer install
composer test
composer generate

composer generate rebuilds endpoint services and DTOs from api-1.json.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages