alissonlinneker/statuspage-php-sdk

行为准则请勿滥用API,并请将所有功能请求和问题报告到https://support.atlassian.com/contact # 速率限制每个API令牌在60秒滚动窗口内限制为每秒1次请求。要增加此限制,请联系我们https

v1.0 2023-06-22 16:04 UTC

This package is auto-updated.

Last update: 2024-09-22 19:41:57 UTC


README

Latest Stable Version

行为准则

请勿滥用API,并请将所有功能请求和问题报告到https://support.atlassian.com/contact

速率限制

每个API令牌在60秒滚动窗口内限制为每秒1次请求。要增加此限制,请联系我们https://support.atlassian.com/contact

错误代码420或429表示您已超过速率限制,请求已被拒绝。

基础

HTTPS

必需的

URL前缀

为了保持版本完整性,API已进行版本化。所有调用目前都以以下前缀开始

https://api.statuspage.io/v1/

RESTful接口

尽可能,API会尝试使用逻辑的、代表性的URL和描述性的HTTP动词实现可重复的模式。以下是一些示例和您将在文档中看到的约定。

发送数据

信息可以以表单urlencoded或JSON格式在正文中发送,但请确保Content-Type头与正文结构匹配,否则服务器将变得愤怒。

所有示例均以JSON格式提供,但它们可以很容易地转换为表单编码,如果需要,以下是一些如何转换的示例

// JSON
{
  \"incident\": {
    \"name\": \"test incident\",
    \"components\": [\"8kbf7d35c070\", \"vtnh60py4yd7\"]
  }
}

// Form Encoded (using curl as an example):
curl -X POST https://api.statuspage.io/v1/example \\
  -d \"incident[name]=test incident\" \\
  -d \"incident[components][]=8kbf7d35c070\" \\
  -d \"incident[components][]=vtnh60py4yd7\"

身份验证

更多信息,请访问https://support.atlassian.com/contact

安装和用法

要求

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

Composer

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

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

然后运行composer install

或者

一旦您安装了Composer,您可以在项目的根目录中运行以下命令来安装statuspage-php-sdk

composer require alissonlinneker/statuspage-php-sdk

手动安装

下载文件并包含autoload.php

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

入门

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

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



// Configure API key authorization: api_key
$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\ComponentGroupsApi(
    // 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
);
$page_id = 'page_id_example'; // string | Page identifier
$id = 'id_example'; // string | Component group identifier

try {
    $result = $apiInstance->deletePagesPageIdComponentGroupsId($page_id, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ComponentGroupsApi->deletePagesPageIdComponentGroupsId: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI均相对于https://api.statuspage.io/v1

模型

授权

为API定义的认证方案

api_key

  • 类型: API密钥
  • API密钥参数名: 授权
  • 位置: HTTP头

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

关于此包

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

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