thampe / troi-sdk
这是 Troi 的官方 API 文档。# 认证 Troi 提供基本认证进行身份验证。<security-definitions />
1.4.2
2024-08-31 14:09 UTC
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
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
模型
- AbsencesGet400Response
- AbsencesGet401Response
- AbsencesIdPutRequest
- AbsencesPost404Response
- AbsencesPostRequest
- AccountGroupsIdPutRequest
- AccountGroupsPostRequest
- AccountingEntriesIdPutRequest
- AccountingEntriesPostRequest
- AccountingEntryCollectionsPostRequest
- AccountsPostRequest
- ApiAbsence
- ApiAbsenceType
- ApiAccount
- ApiAccountGroup
- ApiAccountingEntry
- ApiAccountingEntryCollection
- ApiBookingYear
- ApiCalculationPosition
- ApiCalendarEvent
- ApiCalendarEventParticipant
- ApiClient
- ApiContact
- ApiContactCategory
- ApiCurrency
- ApiCustomer
- ApiEmployee
- ApiHourBilling
- ApiHourBillingCalculationPosition
- ApiHourBillingClient
- ApiHourBillingEmployee
- ApiListItem
- ApiPaymentTerm
- ApiProject
- ApiProjectFolder
- ApiProjectStatus
- ApiProjectType
- ApiService
- ApiSubproject
- ApiSupplier
- ApiSyncItem
- ApiUnit
- ApiWorkingHour
- BillingsHoursIdPutRequest
- BillingsHoursPostRequest
- BookingYearsPostRequest
- CalculationPositionsPostRequest
- CalendarEventParticipantsPostRequest
- CalendarEventsPostRequest
- ContactAccessGroupsGet200ResponseInner
- ContactCategoriesPostRequest
- ContactsPostRequest
- CustomersPostRequest
- ProjectsGetProjectStatusIdParameter
- ProjectsPostRequest
- SuppliersIdPutRequest
- SuppliersPostRequest
授权
API 定义的认证方案
basicAuth
- 类型: HTTP 基本认证
测试
要运行测试,请使用
composer install vendor/bin/phpunit
关于此包
此 PHP 包由 OpenAPI Generator 项目自动生成
- API 版本:
2.0.0
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen