shutterstock / customerio-client
Server-Side Customer.io 通信的 PHP 客户端
2.0.0
2015-07-08 00:23 UTC
Requires
- php: >=5.4
- shutterstock/presto: 2.0.*
This package is not auto-updated.
Last update: 2024-09-24 08:19:26 UTC
README
一个轻量级的客户端,用于处理 customer.io 的 REST 端点(仅限写入)。
更多信息: customer.io REST 文档
安装
使用 composer。
使用方法
确保您使用自动加载和正确的命名空间。
require 'vendor/autoload.php';
use Shutterstock\CustomerIO\Client;
构造函数中要传递的唯一参数是您的站点 ID 和密钥。除非您有全局 CURL 选项,否则可以将它作为可选的第三个数组参数传递。
$client = new Client($site_id, $site_key);
然后就可以使用了。以下是可以做的四项主要操作的列表。
$client->createCustomer($user_id, $user_email, (optional) $user_attributes);
$client->updateCustomer($user_id, $user_email, (optional) $user_attributes);
$client->deleteCustomer($user_id);
$client->trackEvent($user_id, $event_name, (optional) $data);
这四个方法在类中有很好的文档说明。哦,任何失败都将抛出自定义的详细异常,所以您可能想要包装任何调用。