PHP Client for Server-Side Communication

2.0.0 2015-07-08 00:23 UTC

This package is not auto-updated.

Last update: 2023-11-21 03:54:40 UTC


A lightweight client to deal with the REST endpoints of (which are write-only).

More information: rest documentation


Use composer.


Make sure that you use autoloader and the proper namespace.

require 'vendor/autoload.php';
use Shutterstock\CustomerIO\Client;

The only parameters to pass in with construct is your site id and secret key. Unless you have global CURL options, than pass that in as an optional third array parameter.

$client = new Client($site_id, $site_key);

Then just use it. Here is a list of the four main things you can do.

$client->createCustomer($user_id, $user_email, (optional) $user_attributes);
$client->updateCustomer($user_id, $user_email, (optional) $user_attributes);
$client->trackEvent($user_id, $event_name, (optional) $data);

These four methods are well documented in the class. Oh, and any failures will throw custom, verbose exceptions, so you may want to wrap any calls.