wouternl / laravel-drip
为 Drip 的 REST API v2.0 提供的 Laravel 封装
1.2.4
2021-01-14 13:00 UTC
Requires
- php: >=5.5.0
- laravel/framework: 5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0
README
为 Drip 的 PHP 封装其 REST API 的 Laravel 封装
安装
- 在 composer.json 中添加包作为依赖项
composer require wouternl/laravel-drip
- 发布供应商配置文件
php artisan vendor:publish --provider="wouterNL\Drip\DripPhpServiceProvider"
- 将您的 Drip API 密钥添加到位于 app/config/drip.php 的配置文件中。我建议您将此密钥添加到项目的 .env 文件中,而不是直接添加到配置文件中。您可以在用户设置页面找到您的 API 密钥(https://www.getdrip.com/user/edit)。
DRIP_API_TOKEN=your token here
- 将您的 Drip 账户 ID 添加到位于 app/config/drip.php 的配置文件中。我建议您将此密钥添加到项目的 .env 文件中,而不是直接添加到配置文件中。
DRIP_ACCOUNT_ID=Your Account ID here
Laravel <= 5.4
- 将以下行添加到您的 config/app.php 文件中的 providers 数组中
wouterNL\Drip\DripServiceProvider::class,
- 将以下行添加到您的 config/app.php 文件中的 aliases 数组中
'Drip' => wouterNL\Drip\Facades\DripFacade::class,
以下函数可用
- Drip::getCampaigns($params)
- Drip::fetchCampaign($params)
- Drip::getAccounts()
- Drip::deleteSubscriber($params)
- Drip::createOrUpdateSubscriber($params)
- Drip::fetchSubscriber($params)
- Drip::subscribeSubscriber($params)
- Drip::unsubscribeSubscriber($params)
- Drip::tagSubscriber($params)
- Drip::untagSubscriber($params)
- Drip::recordEvent($params)
- Drip::makeRequest($url, $params = array(), $req_method = self::GET)
- Drip::getRequestInfo()
- Drip::getErrorMessage()
- Drip::getErrorCode()
有关 REST API 的更多信息,请访问此链接: https://www.getdrip.com/docs/rest-api