sailing2014/ chat-api-sdk-php
SDK允许您通过WhatsApp账户接收和发送消息。[立即注册](https://app.chat-api.com/) 聊天API基于WhatsApp WEB协议,在使用mgp25等库时不会被禁止。尽管如此,在多次点击“阻止”按钮后,您的账户可能会被WhatsApp的反垃圾邮件系统禁止。
dev-master
2020-05-26 02:34 UTC
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^7.4
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2024-09-26 12:40:53 UTC
README
SDK允许您通过WhatsApp账户接收和发送消息。立即注册
聊天API基于WhatsApp WEB协议,在使用mgp25等库时不会被禁止。尽管如此,在多次点击“阻止”按钮后,您的账户可能会被WhatsApp的反垃圾邮件系统禁止。
此PHP软件包由OpenAPI Generator项目自动生成
- API版本:1.0.0
- 构建包:org.openapitools.codegen.languages.PhpClientCodegen
要求
PHP 5.5及更高版本
安装与使用
Composer
要通过Composer安装绑定,请将以下内容添加到composer.json
{ "repositories": [ { "type": "vcs", "url": "https://github.com/sailing2014/chat-api-sdk-php.git" } ], "require": { "sailing2014/chat-api-sdk-php": "dev-master" } }
然后运行composer install
手动安装
下载文件并包含autoload.php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
测试
要运行单元测试
composer install ./vendor/bin/phpunit
入门指南
请按照安装过程进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: instanceId $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('instanceId', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('instanceId', 'Bearer'); // Configure API key authorization: token $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('token', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); $apiInstance = new OpenAPI\Client\Api\Class1InstanceApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $result = $apiInstance->expiry(); print_r($result); } catch (Exception $e) { echo 'Exception when calling Class1InstanceApi->expiry: ', $e->getMessage(), PHP_EOL; } ?>
API端点文档
所有URI均相对于https://api.chat-api.com
模型文档
- Ack
- BanSettings
- BanTestAction
- BanTestStatus
- Chat
- ChatIdProp
- ChatUpdate
- Chats
- ClearActionsQueueStatus
- ClearMessagesQueueStatus
- CreateGroupAction
- CreateGroupStatus
- ForwardMessageRequest
- GroupParticipantAction
- GroupParticipantStatus
- InlineResponse200
- InlineResponse2001
- InlineResponse2002
- InlineResponse2003
- InlineResponse2004
- InlineResponse2005
- InlineResponse2005Update
- InlineResponse401
- InstanceStatus
- InstanceStatusAction
- InstanceStatusLink
- InstanceStatusStatusData
- InstanceStatusStatusDataActions
- Message
- Messages
- OutboundAction
- OutboundActions
- OutboundMessage
- OutboundMessages
- PhoneProp
- ReadChatAction
- ReadChatStatus
- SendContactRequest
- SendFileRequest
- SendLinkRequest
- SendLocationRequest
- SendMessageRequest
- SendMessageStatus
- SendPTTRequest
- SendVCardRequest
- SetWebhookStatus
- Settings
- Status
- Statuses
- WebhookStatus
- WebhookUrl
授权文档
instanceId
- 类型:API密钥
- API密钥参数名:instanceId
- 位置:URL查询字符串
token
- 类型:API密钥
- API密钥参数名:token
- 位置:URL查询字符串