ABRA FlexiBee - Getting Started with the REST API
TL;DR ✨
This guide is for Linux users starting with the ABRA FlexiBee REST API. Consider an accountant asked to export the latest 100 overdue issued invoices with their variable symbol, amount, specific symbol, and description. The task can be completed manually in FlexiBee, but a repeatable API request saves time when such exports are routine.
Requests are sent from BASH. First verify that an active API user is available; at the time of writing, it cost roughly CZK 3,000 as a one-time purchase. On Debian-based systems, install curl if necessary:
This guide is for Linux users starting with the ABRA FlexiBee REST API. Consider an accountant asked to export the latest 100 overdue issued invoices with their variable symbol, amount, specific symbol, and description. The task can be completed manually in FlexiBee, but a repeatable API request saves time when such exports are routine.
Starting from the Command Line¶
Requests are sent from BASH. First verify that an active API user is available; at the time of writing, it cost roughly CZK 3,000 as a one-time purchase. On Debian-based systems, install curl if necessary:
sudo apt-get install curl
Build a request by specifying curl, credentials, options, the URL with any filters, and an output file. Here, -k ignores certificate validation, -L follows redirects, and -f suppresses output on server errors.
The documentation gives this example for downloading unpaid invoices:
curl -u winstrom:winstrom -k -L -f "https://demo.flexibee.eu:5434/c/demo/faktura-vydana/(stavUhrK!='stavUhr.uhrazeno').pdf" -o neuhrazene-faktury.pdf
Filter syntax is exact: (stavUhrK!='stavUhr.uhrazeno') is not equivalent to (stavUhrK! ='stavUhr.uhrazeno') or (stavUhrK!=stavUhr.uhrazeno).
To download every invoice, use:
curl -u winstrom:winstrom -k -L -f "https://demo.flexibee.eu:5434/c/demo/faktura-vydana.pdf" -o vsechny-faktury.pdf
These endings look similar but behave differently:
/faktura-vydana/(filtry).pdf
/faktura-vydana.pdf
The first filters records; the second returns them all. To request only the latest five, add a limit:
curl -u winstrom:winstrom -k -L -f "https://demo.flexibee.eu:5434/c/demo/faktura-vydana.pdf?limit=5" -o vsechny-faktury-posl-pet.pdf
Available record types are listed at http://demo.flexibee.eu/c/demo/evidence-list. Each type exposes its fields under /properties; the bank fields, for example, are at https://demo.flexibee.eu/c/demo/banka/properties.
A More Useful Filter¶
This command returns up to 100 issued invoices that are unpaid and past their due date, including only the total amount and variable symbol:
curl "https://demo.flexibee.eu:5434/c/demo/faktura-vydana/(stavUhrK%20!=%20'stavUhr.uhrazeno'%20and%20datSplat%20%3C%20now()).xml?detail=custom:sumCelkem,varSym&limit=100" -u winstrom:winstrom -o vydane-faktury.xml
| Query component | Meaning |
|---|---|
(stavUhrK%20!=%20'stavUhr.uhrazeno') |
Selects documents whose status is not “paid.” |
%20and%20 |
The URL-encoded logical operator and; both conditions must hold. |
datSplat%20%3C%20now() |
Selects documents with a due date earlier than today. |
?detail=custom:sumCelkem,varSym |
Limits the output to the total amount and variable symbol. |
&limit=100 |
Caps the response at 100 records. |
URL encoding
The sequence %20 represents a space and %3C represents <. Once decoded,
the filter requires a status other than “paid” and a due date earlier than
today. Invoices with a future due date do not match it.
The author spent roughly two days experimenting and asking support about details absent from the documentation. He also points readers to material by Kaja XIII and Vita Dvorak.