uaizap/sdk
最新稳定版本:1.0.0
Composer 安装命令:
composer require uaizap/sdk
包简介
PHP SDK for uazapiGO
README 文档
README
PHP SDK for the uazapiGO WhatsApp API.
Installation
Install the SDK using Composer:
composer require uaizap/sdk
Usage
Instantiation
To create a new client, you need to provide your API token:
require_once 'vendor/autoload.php'; $client = new Uaizap\Sdk\UaizapClient('YOUR_INSTANCE_TOKEN');
To use the administrative endpoints, you need to create a client with your admin token:
$adminClient = Uaizap\Sdk\UaizapClient::createWithAdminToken('YOUR_ADMIN_TOKEN');
Instances
Create an instance
$instance = $adminClient->initInstance('my-new-instance'); $client->setToken($instance['token']);
List all instances
$instances = $adminClient->listAllInstances();
Connect an instance
$client->connectInstance();
Get instance status
$status = $client->status();
Delete an instance
$adminClient->delete('INSTANCE_ID');
Logout an instance
$client->logout();
Sending Messages
Send a text message
$client->sendText('5511999999999', 'Hello, world!');
Send an image
$client->sendImage('5511999999999', '/path/to/your/image.jpg');
Send a video
$client->sendVideo('5511999999999', '/path/to/your/video.mp4');
Send an audio
$client->sendAudio('5511999999999', '/path/to/your/audio.mp3');
Send a document
$client->sendDocument('5511999999999', '/path/to/your/document.pdf');
Testing
To run the tests, you will need to have PHPUnit installed. You can install it using Composer:
composer require --dev phpunit/phpunit
Then, to run the tests, execute the following command:
./vendor/bin/phpunit
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-16