balfour/php-smsportal

An API client for sending SMSs via the SmsPortal API

1.0.1 2021-07-29 12:06 UTC

This package is auto-updated.

Last update: 2024-04-29 04:27:10 UTC


README

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.