A simple PHP SDK for KeySMS.
This SDK has a dependency on the virtual package php-http/client-implementation which requires to you install a compatible adapter. Any such adapter will be automatically detected. You might for instance want to use Guzzle.
composer require php-http/guzzle6-adapter
composer require fredriktid/key-sms-sdk
<?php
use \FTidemann\KeySms;
$auth = new KeySms\Auth('username', 'apiKey');
$message = new KeySms\Sms\Message();
$message->setContent(new KeySms\Sms\Content('Your message'));
$message->addRecipient(new KeySms\Sms\Recipient(55555555));
$message->addRecipient(new KeySms\Sms\Recipient(66666666));
$client= new KeySms\Client($auth);
$client->setMessage($message);
$client->setHttpClient(new \Http\Adapter\Guzzle6\Client()); // optional
$client->sendSms();