Download the PHP package cleverreach/php-sdk without Composer

On this page you can find all versions of the php package cleverreach/php-sdk. 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 php-sdk

CleverReach PHP SDK

Packagist Version PHP Version

A lightweight PHP SDK for the CleverReach REST API. Built on PSR-18 / PSR-17 interfaces


Table of Contents


Requirements

Requirement Version
PHP 8.2 or higher
Composer 2.x

You also need one PSR-18-compatible HTTP client in your project. Popular choices:

The SDK auto-detects the available client via php-http/discovery – no additional configuration needed.


Installation


Quick Start

Get up and running in under a minute:

That's it. The SDK handles authentication, JSON encoding/decoding, and error mapping automatically.

Get your API token in the CleverReach backend under Account → Extras → REST API.


Features


Typed Service API

The SDK provides typed service classes for the most common endpoints. These are the recommended way to interact with CleverReach – your IDE will autocomplete parameters and the compiler will catch type errors.

Groups

Receivers (via group)

Receiver lookup


Error Handling

All service methods and request() throw exceptions from CleverReach\SDK\Exception\:

Exception When
AuthenticationException 401 – invalid or expired API token
ValidationException 400 – bad request (invalid payload or parameters)
ResourceNotFoundException 404 – resource does not exist (e.g. invalid group ID)
RateLimitExceededException 429 – too many requests
MissingDependencyException No PSR-18 HTTP client found at construction time
CleverReachException Any other API error (4xx/5xx), network failure, or invalid JSON

All specific exceptions extend CleverReachException, so you can catch all errors with a single catch block, or handle specific cases:


Raw API Access

All requests go through the single request() method:

Parameter Type Description
$method string HTTP verb: GET, POST, PUT, DELETE
$endpoint string Path relative to https://rest.cleverreach.com/v3/
$query array URL query parameters (null values are ignored)
$json array\|null Request body, JSON-encoded automatically

Returns array – either an associative array (single object) or a list of associative arrays.

Example: Custom Endpoint

If an endpoint is not yet covered by the typed services, you can easily call it directly:


Full API Reference

The examples above cover the most common use cases. The CleverReach REST API offers many more endpoints – reports, forms, attributes, filters, orders, events, and more.

→ CleverReach REST API Documentation Full endpoint reference, request/response schemas, and interactive Swagger UI.


Advanced: Bring Your Own HTTP Client

By default the SDK uses php-http/discovery to find a PSR-18 client automatically. You can inject your own implementations – ideal for DI containers or testing:

Example: Guzzle with explicit setup


Development


License

This project is licensed under the MIT License. See the LICENSE file for details.


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
php-http/discovery Version ^1.19.2
psr/http-message Version ^2.0
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 cleverreach/php-sdk contains the following files

Loading the files please wait ...