kerekit/salesautopilot-api

SalesAutopilot 邮件营销的 API 客户端

v1.0.3 2022-03-29 16:51 UTC

This package is auto-updated.

Last update: 2024-09-29 06:14:36 UTC


README

功能

  • 为任何资源提供基本的 delete()get()post()put() 方法。
  • 从构造函数参数处理身份验证。
  • 格式化请求并解析响应,失败时抛出通用 Error 实例。

安装

使用以下命令安装最新版本

$ composer require kerekit/salesautopilot-api

基本用法

<?php

use Kerekit\SalesAutopilotApi\Client;

// Init API client with credentials
$api = new Client ('my-username', 'my-api-key');

// Get subscribers by list ID
$list = $api->get ('list/1234');

// Output first subscriber's (if any) email address
$subscriber = reset ($list);
if ($subscriber === false) {
    echo "No subscriber on the list.\n";
} else {
    echo "First subscriber on the list has the email: '$subscriber[email]'\n";
}

API 文档

有关可用资源、参数、请求和响应示例,请参阅官方 API 文档