moneymaxim / trustpilot-invitation-api
用于访问Trustpilot邀请API的PHP库
v0.1.1
2016-01-28 15:13 UTC
Requires
- php: >=5.5.0
- guzzlehttp/guzzle: ~6.0
- moneymaxim/trustpilot-authenticator: ^0.1.1
This package is not auto-updated.
Last update: 2024-09-14 18:26:13 UTC
README
这是一个用于访问Trustpilot邀请API的PHP库。
本库由moneymaxim开发和开源。
我们正在寻找PHP编程人才,如果您对此感兴趣,请联系我们。
安装
使用composer安装
composer install moneymaxim/trustpilot-invitation-api
用法
use Trustpilot\Api\Authenticator\Authenticator; use Trustpilot\Api\Invitation\Client; use Trustpilot\Api\Invitation\Recipient; use Trustpilot\Api\Invitation\Sender; use Trustpilot\Api\Invitation\Context; $authenticator = new Authenticator(); $accessToken = $authenticator->getAccessToken($apiKey, $apiToken, $username, $password); $client = new Client($accessToken); $context = new Context($businessUnitId, $templateId, $redirectUri); // The last two arguments to the Context constructor ($tags and $locale) are optional // $context = new Context($templateId, $redirectUri, $tags = array(), $locale = 'en-US'); $recipient = new Recipient($recipientEmail, $recipientName); $sender = new Sender($senderEmail, $senderName, $replyTo); $client->invite($context, $recipient, $sender, $reference) /* : array */