The viesapi-cli.exe client application allows for quick and automatic checking of entities (contractors) from the command line level (CLI / CMD) in terms of their current status in the VIES system. The application also allows you to save the downloaded data to a file in 3 formats:

  • JSON
  • PROP (list of properties in form of key = value)
  • XML

Application has been successfully tested in the following versions of MS Windows: XP, 7, 10 and 11. The latest version of the application is always available for download from the Prenesi strani.

Celotno funkcionalnost aplikacije lahko preverite – brez potrebe po ustvarjanju računa – z uporabo priloženega Test API

Za uporabo dodatka v produkcijskem API-ju morate ustvariti račun na spletnem mestu viesapi.eu, kupiti najmanj poslovni načrt in ustvariti ključ API in identifikator ključa API.

Postopek registracije in nastavitve računa ter generiranja ključev je opisan na Dokumentacija Spletna stran.

Aktivacija

Izvedljivi program v skupni rabi viesapi-cli.exe ne zahteva namestitve in ga ni treba izvajati pod računom s skrbniškimi pravicami. Če želite zagnati program, izberite Command Prompt aplikacija iz Start meni ali vrsto cmd in the Search programs and files in pritisnite Enter:

Po zagonu konzole pojdite v imenik, v katerem je datoteka zip viesapi-cli.exe je bil prenesen in razpakiran.

Če program zaženete brez podajanja parametrov, se prikaže okno s pomočjo.

Konfiguracija

Zagon viesapi-cli.exe aplikacija brez navedbe API key ID in API key omogoča povpraševanje po testnem okolju (več podrobnosti o Test VIES API stran).

Za povezavo s proizvodnim okoljem je potrebno priklicati viesapi-cli.exe aplikacijo z avtentikacijskimi parametri, ki so:

  • keyid – parameter mora vsebovati identifikator (ID) ključa API, generiran na računu na spletni strani viesapi.eu,
  • key – parameter mora vsebovati API ključ (Key), generiran na računu na spletni strani viesapi.eu.

Podrobnosti o generiranju identifikatorja in ključa so opisane na Dokumentacija strani. Spodaj je primer klica aplikacije z avtentikacijskimi parametri (keyid in key):

viesapi-cli.exe -keyid XXXXXXXXXXXX -key YYYYYYYYYYYY -vies -format xml

Klicna sintaksa

Syntax of calling the viesapi-cli.exe program:

viesapi-cli.exe <action> [options]

Available actions:

-help – opis parametrov klica programa
-vies – current VIES system status
-account – current account status
-data – get company data from VIES
-data-parsed – get company data from VIES with parsed data
-batch-upload – upload batch of VAT numbers and get batch token
-batch-download – check batch result and download data

Available options:

-keyid string – identifikator ključa API
-key string – API ključ
-euvat number – ID številka za DDV EU s predpono države
-token string – batch token value
-format type – output format type (json, prop, xml), default: json
-file-in path – input file path
-file-out path – output file path
-proxy url – Konfiguracija strežnika proxy HTTP (kot URL http://user:password@hostname:port)

Primeri

POZOR! Naslednji primeri so prilagojeni podatkom, zbranim v testnem okolju. Če želite izvesti preverjanja produkcijskega okolja, dodajte –keyid in –key parametre z ustreznimi vrednostmi za vsako poizvedbo.

1. Checks the current VIES system status and displays the result as XML:

viesapi-cli.exe -vies -format xml

2. Checks the current account status and saves the result to a JSON file:

viesapi-cli.exe -account -file-out result.json.

3. Downloads company data from VIES and displays the result as PROP:

viesapi-cli.exe -data -euvat PL5213003700 -format prop

4. Downloads company parsed data from VIES and saves the result to a JSON file:

viesapi-cli.exe -data-parsed -euvat PL5213003700 -file-out result.json

5. Uploads a batch file (one number per line) and receives a batch token for result checking:

viesapi-cli.exe -batch-upload -file-in numbers.csv

6. Checks the current batch status and saves the result to a JSON file:

viesapi-cli.exe -batch-download -token 1fd853a5-ac9e-490c-81a1-d4900a9c906c -file-out result.json