Skip to content

ApiUsage

Jani Giannoudis edited this page Jan 21, 2026 · 2 revisions

API Usage

Tenant Isolation

To ensure multi-tenant capability, the backend server supports the HTTP header Auth-Tenant. If the optional header is present, it is compared with the tenant of the URL for each REST request.

Auth-Tenant: "MyTenantIdentifier"

For example, the web application sets the Auth-Tenant HTTP header for all subsequent backend requests when the tenant is changed.

OData Queries

The Payroll Engine REST API offers a subset of the Open Data Protocols OData. All API methods that support OData queries have the prefix Query, such as QueryEmployees.

Query Parameter

Parameter Description Example
$filter Filter results by conditions $filter=status eq 'Active'
$orderby Sort results $orderby=created desc
$select Choose specific fields $select=id,name,email'
$top Limit number of results $top=10'
$skip Skip first N results $skip=20

Multiple parameters are separated with the & character.

Filter

Within the $filter parameter you can use the following operators.

Filter Operator

Operator Description Example
eq Compare for equal value status eq 'Active'
ne Compare for not equal value status ne 'Inactive'
gt Compare for greater than value salary gt 50000'
ge Compare for greater or equal value age ge 18'
lt Compare for less than value hours lt 40'
le Compare for less or equal value count le 100'

String Filter

On string fields you can use the following functions.

Function Description Example
contains Test for substring contains(name, 'John')
startswith Test string start startswith(email, 'admin')
endswith Test string end endswith(email, '@company.com')

Logical Filter

Use the following logical operators to combine filter conditions.

Operator Description Example
and Logical AND status eq 'Active' and age gt 18
or Logical OR role eq 'Admin' or role eq 'Manager'
not Logical NOT not contains(name, 'Test')

Order

The $orderby parameter allows one or more fields to be sorted in ascending or descending order. The fields are listed in the sort order:

$orderby=identifier,created

The sort direction is determined by the additional designation field asc (default) or desc:

$orderby=identifier,created desc

Selection

The $select parameter excludes specific field values from the result.

$select=identifier,name,description

Paging

The parameters $top and $skip can be used to query the data page by page. For page queries, both values should be specified:

$top=100&$skip=1400

OData Best Practices

  • Always paginate large datasets - Use $top and $skip
  • Select only the necessary fields - Use $select to reduce payload size
  • Combine filters efficiently - Use the and operator to narrow results early

Clone this wiki locally