Skip to content

An API client for sending SMS via the SmsPortal API

License

Notifications You must be signed in to change notification settings

balfour-group/php-smsportal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-smsportal

An API client for sending SMS via the SmsPortal API.

Installation

composer require balfour/php-smsportal

Usage

use Balfour\SmsPortal\SmsPortalClient;
use GuzzleHttp\Client;

$guzzle = new Client();
$client = new SmsPortalClient(
    $guzzle,
    null, // PSR-6 CacheItemPoolInterface
    '[your client id]',
    '[your secret]'
);

$resp = $client->sendMessage(
    '+27000000000',
    'This is a test message.'
);

If you pass an implementation of a PSR-6 CacheItemPoolInterface, the authentication token will be cached and used for subsequent requests.