thelogicstudio/codat-php

Unofficial PHP SDK for Codat's API

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

This package is auto-updated.

Last update: 2024-07-15 03:23:08 UTC


README

See Codat's API changes

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, navigate to where your composer.json file is and run the command:

composer require thelogicstudio/codat-php

Manual Installation

Download the files and include autoload.php:

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

Getting Started

Please follow the installation procedure and then run the following:

<?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 Endpoints

All URIs are relative to https://api.codat.io

Models

Authorization

Authentication schemes defined for the API:

APIKeyAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

CodatLogin

  • Type: OAuth
  • Flow: implicit
  • Authorization URL: https://identity.codat.io/connect/authorize
  • Scopes:
    • PublicApi: PublicApi

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: v1
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen