Generic properties

You can query entities by generic properties of known datatypes.

To do this, use the following construct:

RequestResponse

DATATYPE('PropertyName') OPERATOR PropertyValue

String

For instance, to query all entities with a certain Title:

RequestResponse

GET http://<hostname>/api/entities/query?query=String('Title')=='title'

Integer

For instance, to query all entities with a certain IntProperty:

RequestResponse

GET http://<hostname>/api/entities/query?query=Int('IntProperty')==1

Long

For instance, to query all entities with a certain LongProperty:

RequestResponse

GET http://<hostname>/api/entities/query?query=Long('LongProperty')==5000000000

Decimal

For instance, to query all entities with a certain DecimalProperty:

RequestResponse

GET http://<hostname>/api/entities/query?query=Decimal('DecimalProperty')==1.5

Float

For instance, to query all entities with a certain FloatProperty:

RequestResponse

GET http://<hostname>/api/entities/query?query=Float('FloatProperty')==1.5

DateTime

For instance, to query all entities created after a certain date:

RequestResponse

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:

RequestResponse

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:

RequestResponse

GET http://<hostname>/api/entities/query?query=Definition.Name == "M.Brand" AND String("BrandLabel", "en-US") == "Fruitful"

Do you have some feedback for us?

If you have suggestions for improving this article,