smstools-api/smstools-php-sdk

There is no license information available for the latest version (v1.0.0) of this package.

Simple PHP SDK for smstools.be

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/smstools-api/smstools-php-sdk

v1.0.0 2025-10-30 14:52 UTC

This package is auto-updated.

Last update: 2025-10-30 15:16:14 UTC


README

A simple PHP SDK for the Smstools.com API (v1).
This client provides an easy way to send SMS or Voice messages and manage your account using your client_id and client_secret.

🚀 Installation

Via Composer

composer require smstools-api/smstools-php-sdk

🔧 Configuration

use Smstools\Client;

$client = new Client(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
    baseUrl: 'https://api.smstools.com/v1/' // optional, default value
);

All requests automatically include:

X-Client-Id: YOUR_CLIENT_ID
X-Client-Secret: YOUR_CLIENT_SECRET

💬 Examples

Send an SMS

require 'vendor/autoload.php';

use Smstools\Client;

$client = new Client('your-client-id', 'your-client-secret');

try {
    $response = $client->sms()->send(
        to: '32470000000',
        message: 'Hello World!',
        sender: 'Smstools'
    );

    echo "✅ Message sent successfully!\n";
    print_r($response);

} catch (Exception $e) {
    echo "❌ Error sending SMS: " . $e->getMessage();
}

Get current balance

require 'vendor/autoload.php';

use Smstools\Client;

$client = new Client('your-client-id', 'your-client-secret');

try {
    $response = $client->balance()->get();
    print_r($response);

} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}