Generic properties
You can query entities by generic properties of known datatypes.
To do this, use the following construct:
DATATYPE('PropertyName') OPERATOR PropertyValue
String
For instance, to query all entities with a certain Title
:
GET http://<HOSTNAME>/api/entities/query?query=String('Title')=='title'
You can also search for an empty string:
/api/entities/query?query=String('Title')==""
This can be used for multi-language queries as well:
/api/entities/query?query=String('Title', 'en-US')==""
Property values initially have a null value. It is only when a value is added and then removed that it becomes an empty string.
Integer
For instance, to query all entities with a certain IntProperty
:
GET http://<HOSTNAME>/api/entities/query?query=Int('IntProperty')==1
Long
For instance, to query all entities with a certain LongProperty
:
GET http://<HOSTNAME>/api/entities/query?query=Long('LongProperty')==5000000000
Decimal
For instance, to query all entities with a certain DecimalProperty
:
GET http://<HOSTNAME>/api/entities/query?query=Decimal('DecimalProperty')==1.5
Float
For instance, to query all entities with a certain FloatProperty
:
GET http://<HOSTNAME>/api/entities/query?query=Float('FloatProperty')==1.5
DateTime
For instance, to query all entities created after a certain date:
GET http://<HOSTNAME>/api/entities/query?query=DateTime('CreatedOn') gte 20141213
The DateTime representation follows the international standard ISO8601 covering the exchange of date and time-related data.
There are two formats available via the REST API itself: YYYYMMDD and YYYYMMDDTHHMMSS.
The following formats are available via the Querying API:
Basic formats
-
yyyyMMdd
-
yyyyMMddTHHmmsszzz
-
yyyyMMddTHHmmsszz
-
yyyyMMddTHHmmssZ
-
yyyyMMddTHHmmss
-
yyyy-MM-ddTHHmmss
Extended formats
-
yyyy-MM-ddTHH:mm:sszzz
-
yyyy-MM-ddTHH:mm:sszz
-
yyyy-MM-ddTHH:mm:ssZ
All of the above with reduced accuracy
-
yyyyMMddTHHmmzzz
-
yyyyMMddTHHmmzz
-
yyyyMMddTHHmmZ
-
yyyy-MM-ddTHH:mmzzz
-
yyyy-MM-ddTHH:mmzz
-
yyyy-MM-ddTHH:mmZ
Accuracy reduced to hours
-
yyyyMMddTHHzzz
-
yyyyMMddTHHzz
-
yyyyMMddTHHZ
-
yyyy-MM-ddTHHzzz
-
yyyy-MM-ddTHHzz
-
yyyy-MM-ddTHHZ
Boolean
Booleans do not support any operators, but can be negated.
For instance, to query all draft entities:
GET http://<hostname>/api/entities/query?query=Bool('IsDraft')
Multilanguage properties
To use multilanguage properties when querying entities, specify the culture to filter on.
For instance, to fetch all the M.Brand
entities with the fruitful Brandlabel
, in en-US:
GET http://<HOSTNAME>/api/entities/query?query=Definition.Name == "M.Brand" AND String("BrandLabel", "en-US") == "Fruitful"