Filtering
Dataloy REST API uses a generic search/filtering functionality. In general, all resources supports filtering on all properties of that resource and linked resources (for exceptions, see Limitations).
Syntax
The filter query parameter has the following format:
|
Example that will return currency information for USD:
|
Syntax Breakdown
<Base URL>
For more information see Getting Started with Dataloy REST API
<Resource>
Can be any of the Resources available in the Dataloy API.
<json property>
Can be any json property of the resource (for exceptions, see Limitations).
<OPERATOR>
The operator is always:
surrounded by parenthesis
is always upper case
List of Operators
Operator | Description | API Version | Example |
---|---|---|---|
(EQ) | Equals Exact Value, case sensitive | Get a Document with document number 2707374: Document?filter=documentNo(EQ)2707374 | |
(NE) | Not Equal | Get all Documents not in company 1000: Document?filter=company.companyCode(NE)1000 | |
(GT) | Greater Than ONLY numeric and date values | Get all Voyages modified since 2014-01-01 00:00:00, not including 2014-01-01 00:00:00: Voyage?filter=modifiedDate(GT)2014-01-01T00:00:00 | |
(GTE) | Greater Than or Equal ONLY numeric and date values | Get all Voyages modified since 2014-01-01 00:00:00, including 2014-01-01 00:00:00: Voyage?filter=modifiedDate(GTE)2014-01-01T00:00:00 | |
(LT) | Lesser Than ONLY numeric and date values | Get all Documents that has document amount less than 100000: Document?filter=documentAmount(LT)100000 | |
(LTE) | Lesser Than or Equal ONLY numeric and date values | Get all Documents that has document amount less than 100000, including 100000: Document?filter=documentAmount(LT)100000 | |
(IN) | Equals One of the Elements in a Given List | Get all Documents that are ready for posting and has status type INI, INO, CRI or CRO: Document?filter=invoicingStatus.statusTypeCode(EQ)RFP&filter=invoicingStatus.statusTypeCode(IN)(INI,INO,CRI,CRO) | |
(NULL) | Filter for NULL values | 2.10 | Get all Documents without business partner: Document?filter=businessPartner(NULL) |
(NOTNULL) | Filter for NOT NULL values | 2.10 | Get all Voyages with vessel: Voyage?filter=vessel(NOTNULL) |
(LK) | Like operator | 3.3 | Get all BunkerOrder with externalReferenceNo containing exactly the string "test": BunkerOrder?filter=externalReferenceNo(LK)test |
(LKIC) | Like ignore case operator | 3.3 | Get all BunkerOrder with externalReferenceNo containing the string "test" regardless upper or lower case: BunkerOrder?filter=externalReferenceNo(LKIC)tEsT |
<value>
Numeric Values are straight forward. Can be integers or decimal numbers using a dot as decimal point.
Dates must be specified in the format: yyyy-MM-ddTHH:mm:ss
Strings can be surrounded by double quotes, but it is generally not necessary. Even if the string has spaces.
Boolean must be specified with 0 for false and 1 for true.
Combining Filters
The filter URL parameter can be added multiple times to filter on multiple properties in one request. To do so, add a new filter parameter to the end of the URL
Syntax for Combining Filters
|
Example:
|
Properties for Sub Objects
Filters can be used for sub objects by using a "dot path". Example of a sub object is commodity on Cargo:
To search for cargoes with commodity steel:
|
Limitations
The following properties are currently not possible for filtering:
self
remarks
A few other properties are unsupported, these are documented for each resource.
Examples
Cargo
Get Cargo with freight more than 1000000 and freightCurrency USD or EUR:
|
Document
Get Documents with documentType "INV" and invoicingStatus "PEN"
|
Voyage
Get Voyages for the vessel with vessel code ABRA
|
Get Voyage with reference number VES100
|
Get Voyage with start date > 01.01.2016 and operator is user with userCode "BAK"
|
Get Voyages that are operational for vessel ABRA
|
Get all Voyages that has Oslo as Load Port in 2015
|
Last updated