ducksms/ducksms-php

Ducksms 是一家领先的短信消息服务提供商,提供从您的互联网电脑上发送单向短信通信服务。API 允许您直接与我们 SMS 网关系统进行通信和管理短信。

dev-main 2023-01-20 08:25 UTC

This package is not auto-updated.

Last update: 2024-09-28 16:00:03 UTC


README

Ducksms 是一家领先的短信消息服务提供商,提供从您的互联网电脑上发送单向短信通信服务。API 允许您直接与我们 SMS 网关系统进行通信和管理短信。

官方 API 文档

https://ducksms.stoplight.io/

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

  • API 版本:1.0.0
  • 包版本:1.0.0
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen 更多信息请访问 https://ducksms.com/

要求

PHP 5.5 及以上版本

安装与使用

Composer

要从 ComposerPackagist 安装绑定,请在控制台运行以下命令

composer require ducksms/ducksms-php

如果您希望从 Github 仓库通过 Composer 安装绑定,请将以下内容添加到 composer.json

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/ducksms/ducksms-php.git"
    }
  ],
  "require": {
    "ducksms/ducksms-php": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

require_once('/path/to/ducksms-php/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

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

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



$apiInstance = new Ducksms\Api\CreditApi(
    // 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->creditBalance();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CreditApi->creditBalance: ', $e->getMessage(), PHP_EOL;
}

?>

授权文档

BearerToken

  • 类型:Bearer 认证(JWT)
// Configure Bearer (JWT) authorization: BearerToken
$config = Ducksms\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

API 端点文档

所有 URI 都是相对于 https://ducksms.com

模型文档

获取帮助/支持

请联系 support@ducksms.com,我们可以采取更直接的措施来找到解决方案。