smstools-api / smstools-php-sdk
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
Requires
- php: >=8.0
- ext-json: *
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(); }