vgrish/yclients-openapi-php

yclients-openapi-php 包基于 openapi schema 为 YCLIENTS 生成的

1.0.1 2024-08-04 10:12 UTC

This package is auto-updated.

Last update: 2024-09-04 10:35:26 UTC


README

yclients-openapi-php 包基于 openapi schema 为 YCLIENTS 生成的

安装与使用

需求

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

Composer

通过 Composer 安装绑定,请在 composer.json 中添加以下内容

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/vgrish/yclients-openapi-php/"
    }
  ],
  "require": {
    "vgrish/yclients-openapi-php": "main"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

入门指南

请遵循 安装过程,然后运行以下命令

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




$apiInstance = new Vgrish\YclientsOpenApi\Api\DefaultApi(
    // 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()
);
$accept = application/vnd.yclients.v2+json; // string | e.g. application/vnd.yclients.v2+json
$content_type = 'content_type_example'; // string | application/json
$authorization = Bearer {{partner_token}}; // string | Bearer partner_token
$auth_user_request = {"login":"{{login}}","password":"{{password}}"}; // \Vgrish\YclientsOpenApi\Model\AuthUserRequest

try {
    $result = $apiInstance->authUser($accept, $content_type, $authorization, $auth_user_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->authUser: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都相对于 https://api.yclients.com/api/v1

模型

授权

端点不需要授权。

作者

Vgrish@gmail.com

关于此包

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

  • API 版本:1.0.0
    • 包版本:1.0.0
    • 生成器版本:4.3.1
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen