thelogicstudio/codat-php

Codat API 的非官方 PHP SDK

v1.0.2 2024-01-15 02:06 UTC

This package is auto-updated.

Last update: 2024-09-15 03:44:46 UTC


README

查看 Codat 的 API 更改

安装 & 使用

要求

PHP 7.4 及更高版本。也应与 PHP 8.0 兼容。

Composer

要使用 Composer 安装绑定,请导航到您的 composer.json 文件所在位置,并运行以下命令

composer require thelogicstudio/codat-php

手动安装

下载文件并包含 autoload.php

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

入门

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

<?php
require_once(__DIR__ . '/vendor/autoload.php');
[UPDATING.md](UPDATING.md)


// Configure OAuth2 access token for authorization: CodatLogin
$config = TheLogicStudio\CodatPHP\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

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


$apiInstance = new TheLogicStudio\CodatPHP\Api\AccountTransactionsApi(
    // 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
);
$company_id = 'company_id_example'; // string
$connection_id = 'connection_id_example'; // string
$account_transaction_id = 'account_transaction_id_example'; // string

try {
    $result = $apiInstance->companiesCompanyIdConnectionsConnectionIdDataAccountTransactionsAccountTransactionIdGet($company_id, $connection_id, $account_transaction_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountTransactionsApi->companiesCompanyIdConnectionsConnectionIdDataAccountTransactionsAccountTransactionIdGet: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都是相对于 https://api.codat.io

模型

授权

API定义的认证方案

API密钥认证

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

公共API登录

  • 类型OAuth
  • 流程暗示
  • 授权URLhttps://identity.codat.io/connect/authorize
  • 作用域:
    • PublicApi:PublicApi

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

关于此包

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

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