smstools-api/smstools-php-sdk
最新稳定版本:v1.0.0
Composer 安装命令:
composer require smstools-api/smstools-php-sdk
包简介
Simple PHP SDK for smstools.be
README 文档
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(); }
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-10-30