create event - GeoSmartCity-CIP/crowd-sourcing GitHub Wiki

Event Creation

Event is submitted via HTTP POST method.

URL event/create

Attribute id uniquelly identifies the newly created event. UUID is expected as the identifier. The attribute is optional, if not used a new UUID is generated on the server side.

Attribute description is a free text describing the event. The attribute is optional.

Attribute priority is optional. If not presented value of property priority-default will be used.

Attribute user holds user identification, i.e. user id and password. The attribute is optional if user authentification isn't required.

Attribute location contains coordinates of a place where the event occured and CRS of the coordinates. The attribute is obligatory.

Attribute datetime represents a creation time of the event. The attribute is optional. If not present, current time is used. This is usually not a problem as client is in the most cases online.

Attribute media is optional and contains mime type and reference to data. Data is passed in form of multipart request.

{
   "id": "FB69EEF4-8FCB-4EFB-9F8A-EB6314B8A53B",
   "description": "Event with one attachment",
   "media": [{"mime-type": "image/jpeg", "uri": "part://1"}],
   "user": {
      "id": "mole",
      "password": "tunnel"
   },
   "location": {
      "lat": 23.43,
      "lon": 33.1,
      "crs": "epsg:4326"
   },
   "priority": "normal",
   "datetime": "2016-03-07T15:48:36Z"
}

Attribute media contains multiple objects if multiple attachments are part of the event.

   "media": [
      {"mime-type": "image/jpeg", "uri": "part://1"},
      {"mime-type": "image/jpeg", "uri": "part://2"}
   ]