lucassmacedo/whatsapp-chat-api

该SDK允许您通过您的WhatsApp账户接收和发送消息。[立即注册](https://app.chat-api.com/) Chat API基于WhatsApp WEB协议,在使用类似mgp25的库时不会受到限制。尽管如此,您的账户在多次点击“屏蔽”按钮后可能会被WhatsApp的防垃圾邮件系统禁用。

dev-master 2020-06-02 19:19 UTC

This package is auto-updated.

Last update: 2024-09-29 05:55:43 UTC


README

该SDK允许您通过您的WhatsApp账户接收和发送消息。立即注册

Chat API基于WhatsApp WEB协议,在使用类似mgp25的库时不会受到限制。尽管如此,您的账户在多次点击“屏蔽”按钮后可能会被WhatsApp的防垃圾邮件系统禁用。

此PHP包是由OpenAPI Generator项目自动生成的

  • API版本:1.0.0
  • 包版本:1
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen

要求

PHP 5.5及更高版本

安装与使用

Composer

要使用Composer安装绑定,请将以下内容添加到composer.json

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/lucassmacedo/whatsapp-chat-api.git"
    }
  ],
  "require": {
    "lucassmacedo/whatsapp-chat-api": "*@dev"
  }
}

然后运行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 = WhatsAppChatApi\Configuration::getDefaultConfiguration()->setApiKey('instanceId', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAppChatApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('instanceId', 'Bearer');

// Configure API key authorization: token
$config = WhatsAppChatApi\Configuration::getDefaultConfiguration()->setApiKey('token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAppChatApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer');


$apiInstance = new WhatsAppChatApi\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

模型文档

授权文档

instanceId

  • 类型:API密钥
  • API密钥参数名称:instanceId
  • 位置:URL查询字符串

token

  • 类型:API密钥
  • API密钥参数名称:token
  • 位置:URL查询字符串

作者

sale@chat-api.com