bravecollective/neucore-api

Neucore API客户端库

2.4.0 2023-11-14 21:00 UTC

README

版本号与Neucore版本号对应。

更新时,请检查.openapi-generator/VERSION中的生成器版本,新版本可能会破坏向后兼容性。

重大变更

  • 1.43.0
    Player.character_id现在为整数,而不是字符串。
  • 1.33.0
    需要PHP ^7.4 或 ^8.0
  • 1.31.1
    更新guzzlehttp/guzzle到^7.3(从^6.2 或 ^7.2)
  • 1.26.0
    需要PHP ^7.3 或 ^8.0
  • 1.21.0
    需要PHP 7.2+
  • 1.14.0
    API现在分为几个标签。这意味着现在有多个Api PHP类,而不仅仅是单个类,方法保持不变,但已移动到其他类。
  • 1.4.0
    从OpenAPI v3定义文件生成。
    授权配置已更改,请使用setAccessToken()代替setApiKey(),见下文。

OpenAPIClient-php

Neucore API客户端库

安装 & 使用

需求

PHP 7.4及以后版本。也应与PHP 8.0兼容。

Composer

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

{
  "require": {
    "bravecollective/neucore-api": "^2.4"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

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

入门

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

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



// Configure Bearer authorization: BearerAuth
$config = Brave\NeucoreApi\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


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

API端点

所有URI都是相对于https:///api

模型

授权

API定义的认证方案

BearerAuth

  • 类型:Bearer认证

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

关于此包

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

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