Paging and order

LawPanel syntax

All top-level API resources have support for bulk fetches via "read" API methods.

For instance you can read registries, read clients, and read invoices.

These list API methods share a common structure, taking at least these three parameters: skip, take and order:

Name Type Description Default Required
skip int

The skip parameter omits the specified number of returned records, starting always from the first record.

0 Optional
take int

The take parameter controls how many records the API returns.

If you use it with the skip parameter, the first record returned will be at the position skip+1.

If the skip parameter does not exists, it returns the first records.

If you do not specify this value, the default value is 10.

Max value allowed for take is 100.

10 Optional
order string

An string used to define the order for the entities returned.

The syntax is an json array of arrays: [ [ORDER 1], [ORDER 2], ... [ORDER n] ].

Each order component is composed by: [field_name,direction]. Both, field_name and direction are string values.

Possible values for direction:

  • asc: Ascending
  • desc: Descending

By example, if you want to order by a field called first_name in ascending direction, and then by another field called last_name in descending, your order string would be like this:

[["first_name","asc"],["last_name","desc"]]

The orders priorities are evaluated from left to right, similar to SQL sentences.

null Optional

All responses of read actions, will contain the following values in the http headers:

Name Type Description
Total int

The Total header contains the total of entities without any kind of filters.

Taken int

The Taken header shows how many entities in the current response.

Skipped string

The Skipped header shows the amount of entities skipped for this reponse.



Go to the API reference.