merge-api/merge-hris-php

构建与多个 HR 信息系统平台丰富集成的统一 API。

dev-main 2024-03-13 18:14 UTC

README

构建与多个 HR 信息系统平台丰富集成的统一 API。

更多信息,请访问 https://www.merge.dev/

安装与使用

要求

  • PHP 7.2 及以上版本。
  • guzzlehttp/guzzle 6.X 或 7.X。

Composer

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

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/merge-api/merge-hris-php.git"
    }
  ],
  "require": {
    "merge-api/merge-hris-php": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

入门指南

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

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



// Configure API key authorization: tokenAuth
$config = MergeHRISClient\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MergeHRISClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new MergeHRISClient\Api\AccountDetailsApi(
    // 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
);
$x_account_token = 'x_account_token_example'; // string | Token identifying the end user.

try {
    $result = $apiInstance->accountDetailsRetrieve($x_account_token);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountDetailsApi->accountDetailsRetrieve: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都是相对于 https://api.merge.dev/api/hris/v1

模型

授权

tokenAuth

  • 类型: API密钥
  • API密钥参数名称: 授权
  • 位置: HTTP头

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

hello@merge.dev

关于此包

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

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