REST API – dokumentácia pre vývojárov

V prípade akýchkoľvek otázok nás neváhajte kontaktovať.

Toto aplikačné rozhranie umožňuje integrovať služby Sokordia iSpis do Vášho vlastného softvéru, napr. lustráciu v centrálnych registroch exekúcií do vášho rozhodovacieho procesu.

API je založené na HTTPS GET/POST. Na jeho používanie musíte:

  • Pristupovať iba cez zabezpečený protokol HTTPS.
  • Byť v systéme zaregistrovaný.
  • Autentizovať sa povolenou metódou.
Možnosti autentizácie:
  1. Zadaním prihlasovacieho e-mailu a hesla v query parametroch email/password.
  2. Pomocou HTTP Basic autentizácie, kedy login a heslo sú zasielané v štandardnej hlavičke Authorization.
  3. Pomocou OAuth 2.0 autentizácie: prístupový token získate cez endpoint /oauth/token zadaním loginu a hesla; získaný token potom uveďte v hlavičke Authorization: Bearer .

    TOKEN=$(curl -s -X POST https://ispis.cz/oauth/token -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=client_credentials&client_id=(email)&client_secret=(password)' | jq -r .access_token) && curl -s https://ispis.cz/api/... -H "Authorization: Bearer $TOKEN"

Pre produkčný prístup odporúčame založiť si špeciálny účet s oprávnením len k danej službe a použiť autentizáciu OAuth 2.0. Pre obmedzenie prístupu k API na konkrétne IP adresy, prípadne pre nastavenie ďalších parametrov prístupu, nás neváhajte kontaktovať.

Screening API overview

Single queries

The API can be used for on-line queries or for bulk (batch) screenings. For single queries the lustraceSearchSubject function is enough: you pass a person and a screening profile, and the result is returned immediately as a list of key/value pairs, e.g. the key CEEPocet with the value 0.

Bulk (batch) processing

For bulk screenings you create a batch and then poll its processing status periodically.

The batch is created with lustraceCreateBatch, which takes an array (set) of persons and a screening profile and returns a batch identifier generated by the system, e.g. 20150101.100. With lustraceBatchDetails you can then poll the processing status of the batch and, once it is finished, download all results.

Input parameters and output format

The input is typically a person, given by first name, surname and date of birth, or by the personal identification number, or by the company ID. Some registers accept other inputs as well (e.g. a file number for a file detail, or a document number for a document validity check).

The screening profile is one of the preconfigured lists of registers you want to query. They are listed in the screening form on the Screening page, e.g. Zakladni,CEE or ExeSR. If you want a single register, its code can be used as the profile (see the list of registers). On request we can create a custom profile (a combination of registers) for you.

The particular keys that may appear in the output are described in the documentation of the registers you queried.

API functions

The overview and description of all available REST API functions (cases, claims, payments, screening, ...) is in the API documentation.

api/lustraceSearchSubject - single on-line screening

Input parameters:

  • profile – screening profile (e.g. "CEE", "ISIR", "Devel", ...).
  • Jmeno, Prijmeni, Narozen, RC, IC, ... – a meaningful subset identifying the person.

Output values:

  • batchId: our ID assigned to the screening (also shown in Billing etc.).
  • done: always 1 for single screenings.
  • warnings: errors, if any, to be shown to the user.
  • files: names of the attachments of the screening output.
  • detail: list of key/value pairs with the screening result itself.
  • costCents: price of the query in hundredths (hellers / cents) including VAT. A contractual flat fee for the service (typically for bailiff offices) is not included.
  • balanceCents: credit balance in hundredths including VAT after the query has been charged.

Example

curl -o output.json 'https://ispis.cz/api/lustraceSearchSubject?username=...&password=...&profile=Devel&Jmeno=Jan&Prijmeni=Svoboda&Narozen=14.6.1983'

{
  "batchId": "20151123.5",
  "detail": {
    "CasLustrace": "2014-11-23T22:29:59",
    "Complex_JSON": "[{"Date":"2014-11-23"},{"Time":"22:29:59"}]",
    "Devel": "test",
    "Jmeno": "Jan",
    "Narozen": "1981-03-14",
    "Osloveni": "Svobodo",
    "Prijmeni": "Svoboda"
  },
  "done": 1,
  "files": [],
  "warnings": null,
  "costCents": 3025,
  "balanceCents": 1241075
}

The output itself is in the detail field. The particular keys that may appear there are described in the documentation of the registers you queried.

For historical reasons, keys ending in JSON are given as text values in JSON format.

We recommend storing the detail field on your side again as a list of key/value pairs (or as JSON).

Test interface

For development and testing of the screening API you can use theDevel register, which is free of charge.

For a natural person on input, this register returns the surname in the vocative form and a Complex_JSON structure.

For a legal entity (company ID) it returns one PDF document.