1msg/one_msg_waba_sdk

[1MSG.IO](https://1msg.io/) 是您企业理想的WhatsApp管理工具。与我们合作,您可以完全访问官方的WhatsApp API/webhooks。每个API请求都必须包含一个包含令牌的授权HTTP头。这是您的频道令牌,可在您的个人资料页面上找到的频道项目上。

dev-main 2023-10-12 06:53 UTC

This package is not auto-updated.

Last update: 2024-09-26 17:49:48 UTC


README

1MSG.IO 是您企业理想的WhatsApp管理工具。与我们合作,您可以完全访问官方的WhatsApp API/webhooks。

每个API请求都必须包含一个包含令牌的授权HTTP头。这是您的频道令牌,可在您的个人资料页面上找到的频道项目上。请勿将令牌提供给任何人或公开发布。

授权令牌必须添加到每个请求的GET参数'token'中,并且始终通过查询字符串(?token={your_token})传递。GET查询中的参数通过查询字符串传递。POST请求中的参数通过JSON编码的请求体传递。

所有'send'方法(除/sendTemplate外)仅在用户对话会话打开时才能工作。我们的某些解决方案简化并避免了此类限制,但我们敦促您更加注意这个细节。

安装与使用

需求

PHP 7.4及以后版本。也应与PHP 8.0兼容。

Composer

要通过Composer安装绑定,请运行 composer require 1msg/one_msg_waba_sdk:dev-main

手动安装

下载文件并包含 autoload.php

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

入门

请按照 安装程序 进行操作,然后运行以下命令

<?php

require_once(__DIR__ . '/vendor/autoload.php');

$token = 'INSERT_YOUR_TOKEN_HERE';
$instanceUrl = 'INSERT_YOUR_INSTANCE URL HERE'; // for ex: https://api.1msg.io/123123123/';
// Configure API key authorization: token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('token', $token)->setHost($instanceUrl);
// 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\ChannelApi(
// 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->getMe();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ChannelApi->getMe: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI都是相对于 https://api.1msg.io/YOUR_INSTANCE_NUMBER

模型

授权

API定义的认证方案

token

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

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

hello@1msg.io

关于此包

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

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