Skip to main content

Records Export

How to list records from your app using the REST API?

Written by Petr Pech

In ABRA Flexi, you can list basic data from the application. In general, we distinguish between a list and a detail.

Records can also be listed using /query. If you're interested in the details and want to proceed this way, please refer to our other guide. A short example can also be found at the end of this guide.


List

This is a listing of multiple records. It can be paginated, filtered, sorted, and you can specify the level of detail. The output can be provided in multiple formats.


Detail

A detail always represents just one record, which can be identified in various ways and returned in multiple formats.


Listing Many Specific Records

If you need to retrieve multiple specific records for which you know the identifier (typically an external ID), you have several options.

1. Retrieve Each Record Separately

GET /c/firma/faktura-vydana/1 
GET /c/firma/faktura-vydana/code:2
GET /c/firma/faktura-vydana/ext:SYS:3

⚠️ In this example, the first response to the second and third requests will be a redirect to an address containing a numeric ID. A new request then needs to be sent to that address. HTTP libraries usually know how to follow redirects automatically, but this may need to be enabled.

2. Use Filtering

GET /c/firma/faktura-vydana/(id in (1, 'code:2', 'ext:SYS:3'))

⚠️ URLs that are too long can cause problems, whether in web browsers or on various proxy servers. Learn more about filtering records.

3. Bulk Retrieval of Records by ID

The list of identifiers is passed in the request body, so URL length isn't an issue — this way you can retrieve even several hundred or thousand records at once.

In XML format:

POST /c/firma/faktura-vydana/get.xml 
Content-Type: application/xml

<winstrom>
<id>1</id>
<id>code:2</id>
<id>ext:SYS:3</id>
</winstrom>

In addition to XML, JSON can also be used, and in addition to the POST method, PUT can be used as well:

PUT /c/firma/faktura-vydana/get.json 
Content-Type: application/json

{
"winstrom": {
"id": [1, "code:2", "ext:SYS:3"]
}
}

ℹ️ If a non-existent identifier is specified, it will be ignored. If the same identifier is specified multiple times, or if multiple identifiers pointing to the same record are specified, the output will contain duplicates.


Listing Using /query

Records can also be listed from ABRA Flexi using the so-called /query, where the relevant parameters are sent in the request body.

POST https://demo.flexibee.eu/c/demo/faktura-vydana/query.json 
Content-Type: application/json

{ "winstrom": { ... filtry, detail, parametry } }

You can find all the options and details in our detailed guide.

Did this answer your question?