datana-gmbh / iusta-api
API for iusta.io
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
3.63.0
2024-04-24 12:19 UTC
Requires
- php: >=8.2
- oskarstark/enum-helper: ^1.2
- oskarstark/trimmed-non-empty-string: ^1.0
- psr/log: ^3.0
- symfony/http-client: ^6.0 | ^7.0
- symfony/http-client-contracts: ^3.3
- thecodingmachine/safe: ^2.0
- webmozart/assert: ^1.11
Requires (Dev)
This package is auto-updated.
Last update: 2024-12-24 15:42:26 UTC
README
Usage
Installation
composer require datana-gmbh/iusta-api
Setup
use Datana\Iusta\Api\IustaClient; $baseUri = 'https://api.iusta...'; $token = '...'; $timeout = 10; // optional $client = new IustaClient($baseUri, $token, $timeout); // you can now request any endpoint which needs authentication $client->request('GET', '/api/something', $options);
Cases
In your code you should type-hint to Datana\Iusta\Api\CaseApiInterface
Get by ID (Datana\Iusta\Api\Domain\Value\CaseId)
use Datana\Iusta\Api\CaseApi; use Datana\Iusta\Api\Domain\Value\Case\CaseId; use Datana\Iusta\Api\IustaClient; $client = new IustaClient(/* ... */); $api = new CaseApi($client); $api->getById(new CaseId(123));
Import
In your code you should type-hint to Datana\Iusta\Api\ImportApiInterface
New case (Datana\Iusta\Api\Domain\Value\CaseId)
use Datana\Iusta\Api\ImportApi; use Datana\Iusta\Api\IustaClient; $client = new IustaClient(/* ... */); $api = new ImportApi($client); $api->newCase(/* ... */);