Filtering
Last updated
Last updated
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).
The filter query parameter has the following format:
Example that will return currency information for USD:
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).
The operator is always:
surrounded by parenthesis
is always upper case
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.
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
Example:
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:
The following properties are currently not possible for filtering:
self
remarks
A few other properties are unsupported, these are documented for each resource.
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
Operator | Description | API Version | Example |
---|---|---|---|
<Base URL>/<Resource>?filter=<json property>(OPERATOR)<value>
localhost/ws/rest/Currency?filter=currencyCode(EQ)USD
(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
<Base URL>/<Resource>?filter=<json property>(OPERATOR)<value>&filter=<json property 2>(OPERATOR)<value>
<Base URL>/Document?filter=invoicingStatus.statusTypeCode(EQ)RFP&filter=invoicingStatus.statusTypeCode(IN)(INI,INO,CRI,CRO)
Invoices ready to be transferred to accounting will be returned.
<Base URL>/Cargo?filter=commodity.commodityCode(EQ)10000
/Cargo?filter=freight(GT)1000000&filter=freightCurrency.currencyCode(IN)USD,EUR
/Document?filter=documentType.documentType(EQ)INV&filter=invoicingStatus.statusTypeCode(EQ)PEN
/Voyage?filter=voyageHeader.vesselCode.vesselCode(EQ)ABRA
/Voyage?filter=voyageHeader.referenceNo(EQ)VES100
/Voyage?filter=voyageHeader.voyageStartDate(GT)2016-01-01T00:00:00&voyageHeader.operator.userCode(EQ)BAK
/Voyage?filter=voyageHeader.voyageStatus.statusTypeCode(EQ)OPR&filter=voyageHeader.vesselCode.vesselCode(EQ)ABRA
/Voyage?filter=portCalls.reasonForCall.reasonForCall(EQ)L&filter=portCalls.port.portName(EQ)OSLO&filter=voyageHeader.voyageStartYear(EQ)2015