Skip to content

list event

rszturc edited this page Mar 8, 2016 · 5 revisions

List Events

List of events can be obtained from event/list. It returns JSON-formatted data. For example, the following is output of the service:

[
   {
      "datetime":"2015-12-07T00:00:00",
      "description":"An event with 2 attachments",
      "location":{"crs":"epsg:4326", "lon":33.099998474121094, "lat":23.43000030517578},
      "id":"7ecf5387-9af7-4f8a-a663-a08a8fab16b3",
      "priority":"normal",
      "user":"mole",
      "status":"submitted",
      "media":["http:\/\/localhost:8080\/CrowdSourcing\/media\/aa163ffa-a00d-4cbe-84f7-d4b1746ccb09"]
   }, 
   ...
]

Filters

Various filters can be applied to the listing. They can be combined together. If doing so the subconditions are logically ANDed.

"filter": {
   ...
}

BBOX

Limits number of events to those with location inside given bounding box.

"bbox": {
   "lat-min": 23,
   "lon-min": 33.1,
   "lat-max": 24,
   "lon-max": 33.1,
   "crs": "epsg:4326"
}

Datetime

Number of listed events can be limited by datetime attribute. Time can be specified by attributes from and to. Either one of the attributes or both can be used. For example, the following filter limits events to those created in the given period of time.

"datetime": {
   "from": "2014-12-03T00:00:00",
   "to": "2015-12-03T00:00:00"
}

Only one boundary may be specified. For instance the following will list only events created after December 3 2014. Alternatively, attribute to can be used.

"datetime": {
   "from": "2014-12-03T00:00:00"
}

User

Events can be also selected by creator.

"user": "mole"

Priority

Priority can be used as a filter parameter, too. In this case list of priorities can be specified.

"priority": [ "normal", "high" ]