phpcodex/smsw-php-sdk

1.0.0 2019-06-11 09:58 UTC

This package is auto-updated.

Last update: 2024-09-11 21:39:10 UTC


README

The SMS Works 为开发者提供低成本的可靠 SMS API。仅支付已发送的短信费用,所有失败的消息都将退款。

此 PHP 包由 Swagger Codegen 项目自动生成

  • API 版本:1.0.0
  • 构建包:io.swagger.codegen.languages.PhpClientCodegen

要求

PHP 5.5 及以上

安装与使用

Composer

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

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/phpcodex/smsw-php-sdk.git"
    }
  ],
  "require": {
      "phpcodex/smsw-php-sdk": "^1.0.0"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

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

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

$apiInstance = new Swagger\Client\Api\AuthApi(
    // 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()
);
$customerid = "customerid_example"; // string | The Customer ID

try {
    $result = $apiInstance->keySecret($customerid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthApi->keySecret: ', $e->getMessage(), PHP_EOL;
}

?>

在 Postman 中进行测试调用

Run in Postman

API 端点文档

所有 URI 都是相对于 https://api.thesmsworks.co.uk/v1

模型文档

授权文档

JWT

  • 类型:API 密钥
  • API 密钥参数名:Authorization
  • 位置:HTTP 头部

作者