use infobip\api\configuration\BasicAuthConfiguration;
use infobip\api\model\Destination;
use infobip\api\model\sms\mt\send\Message;
use infobip\api\model\sms\mt\send\textual\SMSAdvancedTextualRequest;
use infobip\api\model\sms\mt\send\Tracking;
// Initializing SendSingleTextualSms client with appropriate configuration
$configuration = new BasicAuthConfiguration(USERNAME, PASSWORD);
$client = new SendMultipleTextualSmsAdvanced($configuration);
// Creating request body
$requestBody = new SMSAdvancedTextualRequest();
$message = new Message();
$destination = new Destination();
$destination->setTo(TO);
$message->setDestinations(array($destination));
$message->setText("This is an example message.");
$tracking = new Tracking();
$tracking->setTrack("SMS");
$requestBody->setMessages(array($message));
$requestBody->setTracking($tracking);
$endLogClient = new LogEndTag($configuration);
// Executing request
try {
    $response = $client->execute($requestBody);
    $sentMessageInfo = $response->getMessages()[0];
    echo "Message ID: " . $sentMessageInfo->getMessageId() . "\n";
    echo "Receiver: " . $sentMessageInfo->getTo() . "\n";
    echo "Message status: " . $sentMessageInfo->getStatus()->getName() . "\n";
    $endTagResponse = $endLogClient->execute($sentMessageInfo->getMessageId());
    echo "Process Key: " . $endTagResponse->getProcessKey();
} catch (Exception $exception) {
    echo "HTTP status code: " . $exception->getCode() . "\n";
 * Created by PhpStorm.
 * User: mmilakovic
 * Date: 18/11/15
 */
require_once __DIR__ . '/../../vendor/autoload.php';
use infobip\api\client\SendMultipleTextualSmsAdvanced;
use infobip\api\configuration\BasicAuthConfiguration;
use infobip\api\model\Destination;
use infobip\api\model\sms\mt\send\Tracking;
use infobip\api\model\sms\mt\send\Message;
use infobip\api\model\sms\mt\send\textual\SMSAdvancedTextualRequest;
// Initializing SendMultipleTextualSmsAdvanced client with appropriate configuration
$client = new SendMultipleTextualSmsAdvanced(new BasicAuthConfiguration(USERNAME, PASSWORD));
// Creating request body
$destination = new Destination();
$destination->setTo(TO);
$message = new Message();
$message->setFrom(FROM);
$message->setDestinations([$destination]);
$message->setText("This is an example message. More information you can find on: http://dev.infobip.com/docs/fully-featured-textual-message");
$tracking = new Tracking();
$tracking->setTrack("URL");
$requestBody = new SMSAdvancedTextualRequest();
$requestBody->setMessages([$message]);
$requestBody->setTracking($tracking);
// Executing request
$response = $client->execute($requestBody);
$sentMessageInfo = $response->getMessages()[0];
echo "Message ID: " . $sentMessageInfo->getMessageId() . "\n";
echo "Receiver: " . $sentMessageInfo->getTo() . "\n";
echo "Message status: " . $sentMessageInfo->getStatus()->getName() . "\n";