PHP code example of bluedogtraining / guzzle-clickatell

1. Go to this page and download the library: Download bluedogtraining/guzzle-clickatell library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bluedogtraining / guzzle-clickatell example snippets


$client = \Bdt\Clickatell\ClickatellClient::factory(array(
    'api_id'   => $apiId,
    'user'     => $user,
    'password' => $password,
));

$client->getCommand('Auth')->execute()->getSessionId();

$client->getCommand('Ping', array('session_id' => $sessionId))->execute();

$result = $client->getCommand('SendMsg', array(
    'to'   => $mobileNumber,
    'text' => $messageContents,
))->execute();

$result->isSuccessful();  // true
$result->getMessageIds(); // array('mobile_number' => 'message_id')

$result = $client->sendMessage($mobileNumber, $messageContents); // true|false

$client->getCommand('QueryMsg', array(
    'apimsgid' => $messageId,
))->execute()->getStatus();