wasolution/api-client
最新稳定版本:v1.0.0
Composer 安装命令:
composer require wasolution/api-client
包简介
A PHP client for WhatsApp Solution API using WASolution API Client
README 文档
README
A PHP client for interacting with the WhatsApp Solution API. This package provides a simple and elegant way to send WhatsApp messages through the WASolution platform.
Requirements
- PHP 7.4 or higher
- Guzzle HTTP Client 7.0 or higher
Installation
You can install the package via composer:
composer require wasolution/api-client
Usage
use WASolution\WAClient; // Initialize the client with your credentials $client = new WAClient( 'your-app-key', // Get this from your WASolution dashboard 'your-auth-key' // Get this from your WASolution dashboard ); // Send a message try { $response = $client->sendMessage( '60123456789', // Recipient's phone number 'Hello from PHP!' // Your message ); print_r($response); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
Response Format
A successful response will look like this:
{
"message_status": "Success",
"data": {
"from": "601987654321",
"to": "60123456789",
"status_code": 200
}
}
Error Handling
The package throws exceptions for various error cases:
- Invalid credentials
- Network errors
- API errors
- Invalid phone numbers
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. Make sure to:
- Follow the existing code style
- Add tests for any new functionality
- Update documentation as needed
Security
If you discover any security related issues, please email suppport@wasolution.getligeeasy.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-24