Download the PHP package xqueue/maileon-api-client without Composer

On this page you can find all versions of the php package xqueue/maileon-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package maileon-api-client

Latest Version License PHP Version Require

Maileon API Client

Provides an API client to connect to XQueue Maileon's REST API and (de-)serializes all API functions and data for easier use in PHP projects.

Maileon's REST API documentation can be found here.

For runnable examples and integration tests see the maileon-php-api-client-examples repository.

Table of contents

Requirements

The API client requires PHP >= 7.4 with libxml and libcurl.

Additionally, all requests use an SSL encrypted API endpoint. To enable SSL support in CURL, please follow these steps:

  1. Download the official SSL cert bundle by CURL from https://curl.haxx.se/ca/cacert.pem
  2. Save the bundle to a directory that can be accessed by your PHP installation
  3. Add the following entry to your php.ini (remember to change the path to where you put the cert bundle):

Installation

You can add this library to your project using Composer:

Configuration

All services accept a configuration array as their constructor argument. The following keys are supported:

Key Required Default Description
API_KEY yes — Your Maileon REST API key
BASE_URI no https://api.maileon.com/1.0 Override the API base URL (e.g. for staging)
DEBUG no false Print cURL session logs and response details. Do not enable in production — output may contain sensitive data
THROW_EXCEPTION no true Throw a MaileonAPIException on connection errors or 5xx responses. When false, those calls return null instead
TIMEOUT no 5 cURL connect and total timeout in seconds
PROXY_HOST no — Proxy hostname or IP
PROXY_PORT no 80 Proxy port

Usage

The API client divides the features of Maileon's REST API into specific consumable services. Each service provides all functions of its specific category.

The following services are available:

Response handling

Every service method returns a MaileonAPIResult object. Use the following methods to inspect it:

Method Return type Description
isSuccess() bool true if the HTTP status code is 2xx
isClientError() bool true if the HTTP status code is 4xx
getStatusCode() int The raw HTTP status code
getResult() mixed The deserialized response payload (typed object, array, or raw string depending on endpoint)
getResultXML() SimpleXMLElement\|null The response body parsed as XML, or null if the response was not XML
getBodyData() string\|null The raw response body string
getResponseHeader(string $header) string\|null A single response header value by name (case-insensitive)
getResponseHeaders() array All response headers as an associative array

The x-pages response header is used by paginated endpoints to indicate the total number of available pages.

When THROW_EXCEPTION is true (default), connection errors and 5xx responses throw a MaileonAPIException. When it is false, those calls return null — check for null before calling any method on the result.

Examples

Contact examples

Report example

Mailing example

Data Extensions examples

Transaction example


All versions of maileon-api-client with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0|^8.0
ext-curl Version *
ext-dom Version *
ext-json Version *
ext-libxml Version *
ext-mbstring Version *
ext-simplexml Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package xqueue/maileon-api-client contains the following files

Loading the files please wait ...