shapin/customerio

This package is abandoned and no longer maintained. No replacement package was suggested.

PHP client for customer.io API

dev-master 2021-12-07 09:37 UTC

This package is auto-updated.

Last update: 2023-12-27 11:26:15 UTC


README

latest version total downloads

Install

Via Composer

$ composer require shapintv/customerio

Usage

// Create HTTP Clients
$behavioralTrackingClient = HttpClient::create([
    'base_uri' => 'https://track.customer.io/api/v1/',
    'auth_basic' => [self::SITE_ID, self::API_KEY],
    'headers' => [
        'Content-Type' => 'application/json',
    ],
]);

$apiClient = HttpClient::create([
    'base_uri' => 'https://api.customer.io/v1/api/',
    'auth_basic' => [self::SITE_ID, self::API_KEY],
    'headers' => [
        'Content-Type' => 'application/json',
    ],
]);

$apiClient = new CustomerIOClient($behavioralTrackingClient, $apiClient);

// Create a customer
$apiClient->customers()->createOrUpdate('my_custom_id', [
    'email' => 'georges@abitbol.com',
]);

License

The MIT License (MIT). Please see License File for more information.