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.

Installs: 27 593

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 4

Forks: 0

Open Issues: 1

pkg:composer/datana-gmbh/iusta-api


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