spojenet/csas-accountsapi

API for managing production accounts.

0.2.0 2024-12-14 08:07 UTC

This package is auto-updated.

Last update: 2024-12-14 09:09:41 UTC


README

API for managing production accounts.

For more information, please visit https://www.csas.cz/content/dam/cz/csas/www_csas_cz/dokumenty/obecne/how-to-connect-to-api-of-cs.pdf.

Installation & Usage

Requirements

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

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/Spoje-NET/php-csas-webapi.git"
    }
  ],
  "require": {
    "Spoje-NET/php-csas-webapi": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/Premium - Accounts API/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

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



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

// Configure Bearer (JWT) authorization: bearerAuth
$config = SpojeNET\Csas\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new SpojeNET\Csas\Api\DefaultApi(
    // 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
);
$id = 'id_example'; // string | Opaque system ID of the account

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

API Endpoints

All URIs are relative to https://www.csas.cz/webapi/api/v3/accounts

Models

Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: Bearer authentication (JWT)

ApiKeyAuth

  • Type: API key
  • API key parameter name: web-api-key
  • Location: HTTP header

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

vitezslav.dvorak@spojenet.cz

About this package

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

  • API version: 1.0.0
    • Generator version: 7.10.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen