Skip to main content

URL Parameters

How to Work with URL Parameters

Written by Lenka Haringerová

The URL used to retrieve data from ABRA Flexi supports many parameters that affect the returned results.

Pagination

Almost every ABRA Flexi API user will sooner or later need to paginate the results returned by the system. For example, by default ABRA Flexi returns only the first 20 results, since the default page size is 20 records. If you need to retrieve additional pages or increase the page size, you must start using parameters.

Key parameters:

limit

This parameter determines how many records are included on a single page.
If you need to retrieve a page with all records at once, set this parameter to 0.

demo.flexibee.eu/c/demo/adresar.xml

Returns the first twenty records from the address book register.

demo.flexibee.eu/c/demo/adresar.xml?limit=5

Returns the first five records from the address book register.

demo.flexibee.eu/c/demo/adresar.xml?limit=0

Returns all records from the address book register.

start

If pagination is required, the limit parameter alone is not sufficient. You must also use the start parameter, which specifies the record number at which the page begins.
The first record and the default value is start=0.

demo.flexibee.eu/c/demo/adresar.xml?limit=5&start=0

Returns a page of 5 records from the address book register, starting at the first record.

demo.flexibee.eu/c/demo/adresar.xml?limit=5&start=5

Returns the second page of 5 records from the address book register. The second page is defined by the start parameter with a value of 5.

add-row-count

When paginating records, it is useful to know when to stop. You can add a parameter to the URL that includes the total number of records available for pagination in the output. This parameter is called add-row-count and accepts the values true or false, depending on whether the total count should be included or not.

demo.flexibee.eu/c/demo/adresar.xml?limit=5&add-row-count=true

Returns a page of 5 records from the address book register. The winstrom element is supplemented with a rowCount attribute containing the total number of records.

demo.flexibee.eu/c/demo/adresar.json?limit=5&add-row-count=true

The same approach can be applied to JSON output as well. In that case, "@rowCount":"457" will be added to the output.

For the fastest possible response from Flexi, we recommend using pagination!

A further optimization is to remove the add-row-count parameter when loading subsequent pages. There is no need to query whether the total count has changed on every page request. Additionally, retrieving this number requires an extra database query in ABRA Flexi, and every unnecessary query adds latency.

Detail Levels

Another very important parameter is detail. This parameter controls which properties of individual records in a given register are included in the output. This is a broad topic, so we will cover it in a dedicated article in the future.
Documentation for the individual detail levels is available on the ABRA Flexi website.

Sorting

In most cases, you will want the records returned by ABRA Flexi to be sorted by a specific property. Why sort records in your own application when ABRA Flexi can handle this for you?
Records are sorted using the order parameter. The value of this parameter is the property by which you want to sort.

demo.flexibee.eu/c/demo/adresar.xml?order=kod

By adding the parameter order=kod to the URL, the system will return records sorted by the Code property. Records will be sorted in ascending order.

demo.flexibee.eu/c/demo/adresar.xml?order=kod@D

If you need to sort records in descending order (useful, for example, when sorting by amount so that invoices with the highest value appear first), append @D after the property name.

Sorting by multiple values is achieved by using the order parameter multiple times. The order in which the order parameters are added to the URL also matters.

demo.flexibee.eu/c/demo/adresar.xml?order=stat&order=kod

This example returns records from the address book register, sorted first by country, and then by code if the country is the same.

demo.flexibee.eu/c/demo/adresar.xml?order=kod&order=stat

A query sorted first by code and then by country will, of course, return different results.

The order parameter can also be used directly in the ABRA Flexi web interface.

Other

ABRA Flexi supports many additional URL parameters. A complete list is available on the Building URLs page, so here we will mention only the most important and most commonly used ones.

Boolean parameters that accept true / false values can be activated simply by including the parameter name (i.e., with an empty value). For example, ?no-ids=true can be written in shorthand as ?no-ids.

only-ext-ids

Flexi outputs include identifiers for every object.
When this parameter is used, only external identifiers of objects will be included in the output.

demo.flexibee.eu/c/demo/adresar.xml?only-ext-ids=true demo.flexibee.eu/c/demo/adresar.json?only-ext-ids=true

In this case, the internal ABRA Flexi identifiers are removed from the output, and only external identifiers are shown for records that contain them.

no-ext-ids

The opposite of the previous parameter is no-ext-ids. When this parameter is used, no external identifiers will appear in the output. The no-ext-ids parameter is primarily used to speed up data retrieval from ABRA Flexi, as every attempt to load external identifiers slows down the output.

demo.flexibee.eu/c/demo/adresar.xml?no-ext-ids=true demo.flexibee.eu/c/demo/adresar.json?no-ext-ids=true

no-ids

Similar to the previous parameter, but with this one no internal ABRA Flexi identifiers will appear in the output. External identifiers, for example, can still be displayed.

The no-ids=true parameter affects exports at all levels, including document line items and embedded relations.

demo.flexibee.eu/c/demo/adresar.xml?no-ids=true demo.flexibee.eu/c/demo/adresar.json?no-ids=true

no-comments

A new boolean parameter no-comments has been added to allow suppression of comments in XML output.

demo.flexibee.eu/c/demo/adresar.xml?no-comments

mode=simple

A new export mode "simple" (?mode=simple) generates minimalist output without ref and showAs attributes, and in the case of XML, also without explanatory comments.

demo.flexibee.eu/c/demo/adresar.xml?mode=simple

code-as-id

This parameter causes the code (abbreviation) to be used as the identifier instead of internal ABRA Flexi identifiers, for registers that support this feature.

demo.flexibee.eu/c/demo/adresar.xml?code-as-id=true demo.flexibee.eu/c/demo/adresar.json?code-as-id=true

This parameter can be combined with no-ids to enable data transfers between individual companies in Flexi. For example, if you need to transfer an address book from company A to company B, the best approach is to use a REST API export from company A and import it into company B. The URL for retrieving the address book would look like this:

demo.flexibee.eu/c/demo/adresar.xml?code-as-id=true&no-ids=true

access-attribs=true

Exposes additional attributes providing information about the editability of a record.

demo.flexibee.eu/c/demo/nabidka-vydana.xml?access-attribs=true

The result for collections might look like this, for example:

<polozkyObchDokladu insertable="true">

<nabidka-vydana-polozka editable="true" deletable="true">

Did this answer your question?