datana-gmbh/iusta-api

API for iusta.io


README

iusta-api

Branch PHP
master PHP

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(/* ... */);