Search assets by metadata

0 votes
Hi everyone,

I am trying to use the Asset Discovery Service in order to search for assets with specific metadata.
I did checkout the:
- general documentation (
- the APIs documentation (
- and I have also found an example on Codepen (
but I have not been able to find any examples on how metadata queries should be actually created.

Could you please help me out?

In particular, I would like to be able to filter assets by type, location (lat, lon), firstEventTime and lastEventTime.

Ps. I have noticed that in the queries that I done till now the values of  firstEventTime and lastEventTime are all set to "1970-01-01T00:00:00.000Z". There may be some problems in timestamp handling.

Thanks for the support.

asked Nov 27, 2017 in Assets by carlo.caprini (120 points)
edited Nov 27, 2017 by carlo.caprini

1 Answer

0 votes
Hi Carlo,

The metadata search traverse all the OC assets levels looking for properties and keys that inclusively match your search words.

i.e. Search for Assets containing Bikes and London

Let us know if you need to search for something else in a different way

We hope this helps you

answered Nov 28, 2017 by pral2a (140 points)
Hi Guillem,

thanks for the response, it helps me for sure!
The search I have in mind should also filter assets in time: is there a way of searching not only by match but also by range?

Here is a real example for my use case: I would like to search for all events taking place during the next weekend. Once identified the min and max timestamps representing my target period (the weekend) how can I create a query that filters all those events whose property firstTimeEvent is included in the period?

I am thinking about a query like this: min_timestamp < firstTimeEvent < max_timestamp .

Thanks for the support.
Any feedback about the filter in time?


We found the lastUpdate parameter is not working fine on the current version of the Discovery API and we are working to fix this. We should have this up and running before the end of the week.

This will allow you to use the assets query properties:

As an example for all the assets you will do:

 Or for an specific site:

The lastUpdate attribute will return you assets updated at this time or later. However for the moment the type query works.

We'll keep you updated!

From what I can see, the firstEventTime and lastEventTime have the same issue you mentioned about the lastUpdate field.

The firstEventTime and lastEventTime are actually the fields that I would need to use for filtering assets. Please let me know:
- when the issue with the date is fixed
- how I can filter assets in the request by firstEventTime and lastEventTime

Thanks, Carlo

Dear Guillem, 

are there any news of the time filtering options for the fields firstEventTime and lastEventTime?

Thanks, Carlo