Warsaw – 19115 Intervention
Transkrypt
Warsaw – 19115 Intervention
in association with Warsaw – 19115 Intervention API allows to obtain information about not emergency issues reported by the Warsaw citizens (problems with roads, snow removal, damage, devastation, etc. ). API allows also to obtain information filtered by the keys. Authorization Basic HTTP Method GET URI Request https://host:port/warszawa/19115/methodname where host and port are the host name and port of the machine. Parameter methodname is name of the method used for 19155 AIP call e.g. getNotifications, getNotificationsForDate, getNotificationsForDistrict getNotifications - returns all notifications getNotificationsForDate - returns notifications filtered by time getNotificationsForDistrict - returns all notifications for defined district The request body for the Charge Amount operation has JSON structure including following parameters: Methodname getNotificationsForDistrict https://host:port/warszawa/19115/ getNotificationsForDistrict?district= district – name of the district e.g. Wola , Bielany, Ursus etc. e.g. https://host:port/warszawa/19115/ getNotificationsForDistrict?district=Ursus 1 in association with Methodname getNotificationsForDate https://host:port/warszawa/19115/ getNotificationsForDate? dateFrom=&dateTo= dateFrom – date in UNIX format (long which represents the milliseconds which have passed since 01.01.1970 UTC) dateTo – date in UNIX format (long which represents the milliseconds which have passed since 01.01.1970 UTC) e.g. https://host:port/warszawa/19115/ getNotificationsForDate?dateFrom=1402485663587&dateTo=1387 197158000 Methodname getNotifications https://host:port/warszawa/19115/ getNotifications?filters= filters – JSON object containing array of filters This method use dedicated filters for dedicated data extraction Filter format “field":"field name","operator":"operator name","value":"value data" Filter parameters are presented below: field name DISTRICT - district DEVICE_TYPE - deviceType STREET - street SUBCATEGORY - subcategory EVENT - event CREATE_DATE - createDate NOTIFICATION_NAME - notificationName TYPE - type 2 in association with SOURCE_TYPE - sourceType operator The equality operator (EQ) The operator inequality (NEQ) Operator majority (GT) The operator of minorities (LT) The operator greater than or equal to (GEQ) Operator less than or equal to (LEQ value Value of data defined in field name e.g. DISTRICT – Wola , e.g. Calling search Wola district "field":"DISTRICT","operator":"EQ","value":"WOLA" Calling search Wola district and reported earlier than 11.06.2014: https://host:port/warszawa/19115/ getNotifications?filters={"filters":[{"field":"DISTRICT", "operator":"EQ","value":"WOLA"},{"field":"CREATE_DATE","o perator":"LT","value":"1402485186272"}],"operators":["AND "]} Response The body of correct response contains the is represented by the following JSON data structure: { "responseCode": "SUCCESS", "responseDesc": "OK", "notifications": [notification list ] } e.g. 3 in association with {"responseCode":"SUCCESS","responseDesc":"OK","notificati ons":[{"siebelEventId":"1ANLR","deviceType":"UNKNOWN","street":"Aleja Jana Pawa II","street2":null,"district":"Wola","city":"Warszawa","h ouseNumber":"15","aparmentNumber":null,"category":"Infras truktura","subcategory":"Drogi","event":"Zapadnita ulica/studzienka","description":null,"createDate":1339655 719000,"notificationNumber":"1359/12","xCoord":7499890.32 8,"yCoord":5788739.773,"notificationType":"INCIDENT","sta tuses":[],"source":"EMPTY"},{"siebelEventId":"1OBMC","deviceType":"UNKNOWN","street":"Obozowa","street2" :null,"district":"Wola","city":"Warszawa","houseNumber":" 87","aparmentNumber":null,"category":"Infrastruktura","su bcategory":"Uszkodzenie lub dewastacja infrastruktury","event":"Zgoszenie uszkodzenia/wykruszenia nawierzchni jezdni ,chodnika, przyj podziemnych, mostw","description":null,"createDate":1342165540000,"not ificationNumber":"2860/12","xCoord":7496392.483,"yCoord": 5790364.689,"notificationType":"INCIDENT","statuses":[]," source":"EMPTY"} The body of failed response contains the request status and error description: Response Header HTTP/1.1 500 Server Error Response Body <data contentType="null" contentLength="0"><![CDATA[]]></data> 4