lancasters/shap-library

此软件包已被废弃,不再维护。未建议替代软件包。

用于轻松集成Lancasters SHAP的库

v0.0.7 2018-11-07 15:28 UTC

This package is not auto-updated.

Last update: 2023-02-09 18:40:26 UTC


README

创建新的ShapLibrary并访问其方法

$apiKey = 'Your api key for the required list"

$shapLibrary = new ShapLibrary($apiKey);
$shapLibrary->detail();

您可以调用实现的方法

详情

返回给定列表的数据类型列表。例如

[ "listName" => 'Blacklisted', "listId" => 1, "ListDetails" => [ "email" ] ]

//@return array $listElements
$shapLibrary->detail();

推送消息

将消息推送到SHAP。它将消息入队到SHAP验证接口。验证后,SHAP将授予信用。此方法返回推送到SHAP的消息数量

消息数组的内内容必须与列表数据类型匹配。使用详细信息调用获取列表信息。

示例

$messages = [["email" => "email@email.com"], ["email" => "email2@email.com"], [...]]

//@return int $totalPushed
$shapLibrary->push(array $messages);

拉取消息

从列表返回新消息。它基于时间戳工作。服务器配置了拉取消息的最大数量限制,在200 - 1000之间。

您必须提供一个与增量查询中“from”对应的时间戳。为了同步整个数据库

GET /pull/1 ... (获取最新时间戳) // 按时间戳排序,以匹配最后一个元素 GET /pull/12843434 ... GET /pull/xxx,直到您得到0条消息作为答案

那时您就知道了您已经更新了。下次您进行获取时,请使用最新时间戳,这样您只收集新消息,而不需要比所需更多的信用。

//@return array $messages
$shapLibrary->pull(int $timestamp);