Implementation of REST API

dev-master 2017-06-21 09:03 UTC

This package is not auto-updated.

Last update: 2021-11-27 13:12:28 UTC


With this package usage of REST API will be more comfortable.

It uses adapters to provide right PSR-7 compatible HTTP service.

Actully implemented ones are:

  • cURL
  • Guzzle6

Feel free to commit new adapters :)

See for massive documentation.


Simply add to your composer.json file

    "require": {
        "preclowski/refreshmailer": "dev-master"

or, require directly using

composer require preclowski/refreshmailer


use ColoursFactory\ReFreshMailer\FreshMailClient;
use ColoursFactory\ReFreshMailer\Http\GuzzleHttpAdapter;
use GuzzleHttp\Client;

$options = [
    'apiKey' => 'abcdef1234567890',
    'apiSecret' => 'abcdef1234567890',

$httpAdapter = new GuzzleHttpAdapter(new Client());
// or
$httpAdapter = new CurlHttpAdapter();

/** @var HttpAdapterInterface $httpAdapter */
$client = new FreshMailClient($httpAdapter, '', $options);

$campaigns = $client->doRequest('/campaigns');

Reporting an issue or a feature request

Issues and feature requests are tracked in the Github issue tracker.