fiteco-group /kimai-client
Kimai V2 PHP API客户端。
0.2.2
2021-08-05 20:07 UTC
Requires
- php: >=7.2|>=8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2024-09-06 02:58:52 UTC
README
Kimai 2时间跟踪软件的JSON API。更多关于其使用的详细信息,请参阅API文档,然后下载Swagger文件以导入,例如在Postman中。请注意:它尚未被认为是稳定的,并且可能发生BC中断,尤其是在使用代码生成时。JSON属性的顺序没有保证。
安装与使用
需求
PHP 7.2及更高版本。
Composer
要使用Composer安装绑定,请在composer.json中添加以下内容
{
"require": {
"fiteco-group/kimai-client": "*@dev"
}
}
然后运行composer install
手动安装
下载文件并包含autoload.php
<?php require_once('/path/to/vendor/autoload.php');
入门
请遵循安装程序,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure host on which Kimai is running $config = Fiteco\KimaiClient\Configuration::getDefaultConfiguration()->setHost('https://kimai.RememberToSetMe.com'); // Configure API key authorization: apiToken $config = Fiteco\KimaiClient\Configuration::getDefaultConfiguration()->setApiKey('X-AUTH-TOKEN', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Fiteco\KimaiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AUTH-TOKEN', 'Bearer'); // Configure API key authorization: apiUser $config = Fiteco\KimaiClient\Configuration::getDefaultConfiguration()->setApiKey('X-AUTH-USER', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = Fiteco\KimaiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-AUTH-USER', 'Bearer'); $apiInstance = new Fiteco\KimaiClient\Api\ActivityApi( // 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 ); $project = 'project_example'; // string | Project ID to filter activities $projects = 'projects_example'; // string | Comma separated list of project IDs to filter activities $visible = 'visible_example'; // string | Visibility status to filter activities. Allowed values: 1=visible, 2=hidden, 3=all (default: 1) $globals = 'globals_example'; // string | Use if you want to fetch only global activities. Allowed values: true (default: false) $globalsFirst = 'globalsFirst_example'; // string | Deprecated parameter, value is not used any more $orderBy = 'orderBy_example'; // string | The field by which results will be ordered. Allowed values: id, name, project (default: name) $order = 'order_example'; // string | The result order. Allowed values: ASC, DESC (default: ASC) $term = 'term_example'; // string | Free search term try { $result = $apiInstance->apiActivitiesGet($project, $projects, $visible, $globals, $globalsFirst, $orderBy, $order, $term); print_r($result); } catch (Exception $e) { echo 'Exception when calling ActivityApi->apiActivitiesGet: ', $e->getMessage(), PHP_EOL; }
API端点
所有URI相对于Kimai安装。
模型
- 活动
- 活动集合
- 活动编辑表单
- 活动实体
- 活动扩展
- 活动元数据
- 活动费率
- 活动费率表单
- 客户
- 客户集合
- 客户编辑表单
- 客户实体
- 客户元数据
- 客户费率
- 客户费率表单
- I18nConfig
- 内联对象
- 内联对象1
- 内联对象2
- 内联对象3
- 内联对象4
- 插件
- 项目
- 项目集合
- 项目编辑表单
- 项目实体
- 项目扩展
- 项目元数据
- 项目费率
- 项目费率表单
- 标签编辑表单
- 标签实体
- 团队
- 团队集合
- 团队编辑表单
- 团队实体
- 时间表集合
- 时间表集合扩展
- 时间表配置
- 时间表编辑表单
- 时间表实体
- 时间表实体扩展
- 时间表元数据
- 用户
- 用户集合
- 用户创建表单
- 用户编辑表单
- 用户实体
- 版本
授权
apiToken
- 类型:API密钥
- API密钥参数名称:X-AUTH-TOKEN
- 位置:HTTP头
apiUser
- 类型:API密钥
- API密钥参数名称:X-AUTH-USER
- 位置:HTTP头
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包由OpenAPI Generator项目自动生成
- API版本:
0.6 - 构建包:
org.openapitools.codegen.languages.PhpClientCodegen