thampe/troi-sdk

这是 Troi 的官方 API 文档。# 认证 Troi 提供基本认证进行身份验证。<security-definitions />

1.4.2 2024-08-31 14:09 UTC

This package is auto-updated.

Last update: 2024-08-31 14:11:07 UTC


README

这是 Troi 的官方 API 文档。

认证

Troi 提供基本认证进行身份验证。

安装 & 使用

要求

PHP 7.4 及更高版本。也应在 PHP 8.0+ 上运行。

Composer

要使用 Composer 安装绑定,请运行以下命令

composer require thampe/troi-sdk 

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

入门

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

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



// Configure HTTP basic authorization: basicAuth
$config = Troi\Configuration::getDefaultConfiguration()
              ->setHost('YOUR_HOST')
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_V2_TOKEN');


$apiInstance = new Troi\Api\AbsencesApi(
    // 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->absencesGet($start, $end, $employee_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AbsencesApi->absencesGet: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都相对于 https://demo.troi.software/api/v2/rest

模型

授权

API 定义的认证方案

basicAuth

  • 类型: HTTP 基本认证

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

关于此包

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

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