Skip to content

seven-io/php-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Official PHP API Client

Installation

Via Composer:

composer require seven.io/api

Alternatively you can download as *.ZIP if you don't use Composer.

Usage

use Seven\Api\Client;
use Seven\Api\Resource\Sms\SmsParams;
use Seven\Api\Resource\Sms\SmsResource;

$client = new Client('MY_VERY_SECRET_API_KEY!');
$smsResource = new SmsResource($client);
$smsParams = new SmsParams('HI2U', '+4901234567890');
$res = $smsResource->dispatch($smsParams);
var_dump($res);

See docs for more details.

Tests

Some basic tests are implemented. You can run them like this:

SEVEN_API_KEY=<API-KEY> php vendor/bin/phpunit tests

or

SEVEN_API_KEY_SANDBOX=<SANDBOX-API-KEY> php vendor/bin/phpunit tests

Make sure to fill in the values.

Support

Need help? Feel free to contact us.

MIT