-
-
Notifications
You must be signed in to change notification settings - Fork 19
ApiUsage
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.
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.
| 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.
Within the $filter parameter you can use the following operators.
| 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' |
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') |
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') |
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,createdThe sort direction is determined by the additional designation field asc (default) or desc:
$orderby=identifier,created descThe $select parameter excludes specific field values from the result.
$select=identifier,name,descriptionThe 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- Always paginate large datasets - Use
$topand$skip - Select only the necessary fields - Use
$selectto reduce payload size - Combine filters efficiently - Use the
andoperator to narrow results early
🤝 Thank you for supporting this project with a donation.
⚡ This is a pre-relase version of the initial development, please read the restrictions.
- Payroll Engine