flowhunt/flowhunt-php-sdk

dev-main 2024-09-25 11:37 UTC

This package is auto-updated.

Last update: 2024-09-25 11:37:16 UTC


README

FlowHunt API

安装与使用

需求

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

Composer

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

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

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

入门指南

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

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



// Configure Bearer authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ApiKeysApi(
    // 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
);
$workspace_id = 'workspace_id_example'; // string
$api_key_create_request = new \OpenAPI\Client\Model\ApiKeyCreateRequest(); // \OpenAPI\Client\Model\ApiKeyCreateRequest

try {
    $result = $apiInstance->createApiKey($workspace_id, $api_key_create_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ApiKeysApi->createApiKey: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都相对于 https://

模型

授权

API定义的认证方案

sudo_api_key_header

  • 类型: API密钥
  • API密钥参数名: Sudo-Api-Key
  • 位置: HTTP头

APIKeyHeader

  • 类型: API密钥
  • API密钥参数名: Api-Key
  • 位置: HTTP头

HTTPBearer

  • 类型: Bearer认证

测试

运行测试,使用

composer install
vendor/bin/phpunit

作者

关于此包

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

  • API版本: 2.0.0
    • 包版本: 2.2.2
    • 生成器版本: 7.7.0
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen