电路ID REST API 的 PHP 包装器

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

This package is auto-updated.

Last update: 2024-09-30 02:13:11 UTC


README

简介

Circuit ID® 是一个创新的云通信平台,重新定义了您的连接体验。我们的尖端 AI 驱动解决方案无缝集成通话、会议、消息、语音邮件、传真、SIP Trunking、移动宽带和移动电话服务,无论您在哪里,无论您的设备在哪里,都可以访问。

无论您是刚开始使用我们 API 的初学者,还是寻找高级功能的经验丰富的开发者,这个文档网站都将作为您的全面指南。

我们非常高兴您加入我们,并相信这个文档网站将赋予您充分利用我们 REST API 的全部潜力。如果您有任何问题或需要进一步的帮助,请随时联系我们的支持团队。

快乐编码!

有关更多信息,请访问 https://www.circuitid.com/

安装和用法

要求

PHP 7.4 及更高版本。也应该与 PHP 8.0 兼容。

Composer

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

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

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

入门指南

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

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



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


$apiInstance = new OpenAPI\Client\Api\AcceptedSendersApi(
    // 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
);
$acceptedsendersCreateOrPatch = new \OpenAPI\Client\CircuitID\AcceptedsendersCreateOrPatch(); // \OpenAPI\Client\CircuitID\AcceptedsendersCreateOrPatch | The JSON object that will be posted to the REST API endpoint.

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

API 端点

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

模型

授权

为API定义的认证方案

jwt

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

测试

要运行测试,请使用

composer install
vendor/bin/phpunit