bluedogtraining/guzzle-clickatell
最新稳定版本:v2.0.5
Composer 安装命令:
composer require bluedogtraining/guzzle-clickatell
包简介
A Guzzle client for interacting with the Clickatell API
关键字:
README 文档
README
A PHP 5.3+ client for interacting with the Clickatell HTTP API.
Installation
Add this to your composer.json by running
composer.phar require bluedogtraining/guzzle-clickatell.
Usage
Create API client
$client = \Bdt\Clickatell\ClickatellClient::factory(array( 'api_id' => $apiId, 'user' => $user, 'password' => $password, ));
Authenticate to the API
$client->getCommand('Auth')->execute()->getSessionId();
Ping the API to keep the session ID alive
$client->getCommand('Ping', array('session_id' => $sessionId))->execute();
Send a message
Passing a session_id parameter is optional. If it isn't present the client
will use the authentication details provided.
$result = $client->getCommand('SendMsg', array( 'to' => $mobileNumber, 'text' => $messageContents, ))->execute(); $result->isSuccessful(); // true $result->getMessageIds(); // array('mobile_number' => 'message_id')
A quicker way to send a message is:
$result = $client->sendMessage($mobileNumber, $messageContents); // true|false
Query a message
$client->getCommand('QueryMsg', array( 'apimsgid' => $messageId, ))->execute()->getStatus();
Running Tests
First, install PHPUnit with composer.phar install --dev, then run
./vendor/bin/phpunit.
More Reading
统计信息
- 总下载量: 18.19k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-02-13