Skip to main content

CleverReach PHP SDK

The official CleverReach PHP SDK provides a seamless, object-oriented way to interact with the CleverReach API. Built on modern PHP standards (PSR-17 and PSR-18), it handles authentication, payload mapping, and error handling so you can focus entirely on building your integration.

Why use the SDK?

  • Zero boilerplate: Connect to the API with a single line of code.
  • Typed Services: Enjoy full IDE autocompletion and strict typing for core endpoints (Groups, Receivers, Mailings).
  • Auto-discovery: It automatically detects and uses your project's existing HTTP client (like Guzzle or Symfony HTTP Client).
  • Robust Error Handling: API errors are beautifully wrapped into actionable PHP exceptions.
  • Raw API Access: Every CleverReach REST endpoint is easily reachable, even if a typed service doesn't exist yet.

Installation & Documentation

Since the SDK is continuously evolving, we maintain the installation instructions, detailed usage examples, and the full feature list directly within the project's repository.

Get started by visiting the official repository:

Quick Code Example

Just to give you a quick glimpse of how clean your API calls can be:

<?php
require __DIR__ . '/vendor/autoload.php';

use CleverReach\SDK\CleverReachClient;

// 1. Initialize the client
$client = new CleverReachClient('YOUR_ACCESS_TOKEN');

// 2. Fetch all groups using the typed service
$groups = $client->groups()->all();

foreach ($groups as $group) {
echo "Group Found: {$group->name} (ID: {$group->id})\n";
}

For all further instructions, including advanced configuration, error handling strategies, and how to utilize the typed service enums, please refer to the comprehensive README on GitHub.