SensLog API v1
SensLog contains RESTful API for Feeder, Provider, VGI and Telemetry module. Most important services and methods will be described in following tables.
- Feeder and Provider module
- ControllerServlet
- FeederServlet
- InsertObservation
- InsertPosition
- InsertAlertEvent
- DataService
- GetUnits
- GetUnitsList
- GetPositions
- GetPositionsDay
- GetLastPositions
- GetLastPositionsWithStatus
- GetTracks
- GetRecentTracks
- SensorService
- GetSensors
- GetObservations
- GetLastObservations
- AlertService
- GetAlerts
- GetAlertEventsByTime
- ManagementService
- InsertUnit
- VGI Module
- VgiObservationService
- InsertVgiObservation
- UpdateVgiObservation
- SelectVgiObservations
- SelectVgiObservation
- DeleteVgiObservation
- VgiMediaService
- ListVgiMedia
- InsertVgiMedia
- UpdateVgiMedia
- GetVgiMedia
- DeleteVgiMedia
- VgiCategoryService
- SelectVgiCategories
- SelectVgiCategory
- SelectVgiCategoryDescendants
- VgiDatasetService
- SelectVgiDatasets
- InsertVgiDataset
- GetVgiDataset
- DeleteVgiDataset
Controller Servlet
Controller servlet allows to login to SensLog and to send further requests.
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/ControllerServlet</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>POST</td>
<td>Request provides users to login to the SensLog</td>
<td>KVP text/plain </td>
</tr>
</tbody>
</table>
Important notes:
HTTP Post request has to contain a Header with value:
Content-Type: application/x-www-form-urlencoded
Example of payload:
username=test&password=demo
Example of correct response:
{"sessionid":"rv6pe5o30091","language":"en","audio":"false"}
Example of HTTP Header <var>Cookie</var> to be added to any further requests:
Cookie: JSESSIONID=rv6pe5o30091; sessionid=rv6pe5o30091; language=en; audio=false
Feeder Servlet
Feeder Servlet allows to insert observations, units positions and alerts.
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/FeederServlet?Operation=<var>operationName</var></td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Provides insertion of main collected objects</td>
<td>URL encoded text/plain</td>
</tr>
</tbody>
</table>
InsertObservation
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/FeederServlet?Operation=InsertObservation</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Provides inserting of new observation for combination of sensor and unit into database. Return true if observation was successfully inserted, false in all other cases.</td>
<td>URL encoded text/plain</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<th>Parameter</th>
<th>Format</th>
<th>Role</th>
</tr>
<tr>
<td>value</td>
<td>Double precision</td>
<td>Measured value (mandatory)</td>
</tr>
<tr>
<td>date</td>
<td>Time stamp (ISO 8601)</td>
<td>Timestamp of measured value (e.g. 2015-07-15 12:00:00+0200) (mandatory)</td>
</tr>
<tr>
<td>unit_id</td>
<td>Numerical value</td>
<td>Identifier of unit (mandatory)</td>
</tr>
<tr>
<td>sensor_id</td>
<td>Numerical value</td>
<td>Identifier of sensor (mandatory)</td>
</tr>
</tbody>
</table>
InsertPosition
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/FeederServlet?Operation=InsertPosition</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Provides inserting of new unit position in the database, position can be inserted only as WGS-84 coordinates. Return true if position was inserted successfully, false in all other cases.</td>
<td>URL encoded text/plain</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<th>Parameter</th>
<th>Format</th>
<th>Role</th>
</tr>
<tr>
<td>lat</td>
<td>Double precision</td>
<td>Latitude (mandatory)</td>
</tr>
<tr>
<td>lon</td>
<td>Double precision</td>
<td>Longitude (mandatory)</td>
</tr>
<tr>
<td>alt</td>
<td>Double precision</td>
<td>Altitude in meters (optional)</td>
</tr>
<tr>
<td>speed</td>
<td>Double precision</td>
<td>Speed of the unit (optional)</td>
</tr>
<tr>
<td>unit_id</td>
<td>Numerical value</td>
<td>Identifier of unit (mandatory)</td>
</tr>
<tr>
<td>date</td>
<td>Timestamp (ISO 8601)</td>
<td>Timestamp of measured value (e.g. 2015-07-15 12:00:00+0200) (mandatory)</td>
</tr>
<tr>
<td>dop</td>
<td>Numerical value</td>
<td>Dilution of precision (optional)</td>
</tr>
</tbody>
</table>
InsertAlertEvent
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/FeederServlet?Operation=InsertAlertEvent</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Provides inserting of new alert event that was detected in the sensor network into database, Return true if event was successfully inserted, false in all other cases.</td>
<td>URL encoded text/plain</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<th>Parameter</th>
<th>Format</th>
<th>Role</th>
</tr>
<tr>
<td>alert_id</td>
<td>Numerical value</td>
<td>Identifier of alert (mandatory)</td>
</tr>
<tr>
<td>unit_id</td>
<td>Numerical value</td>
<td>Identifier of unit (mandatory)</td>
</tr>
<tr>
<td>date</td>
<td>Timestamp (ISO 8601)</td>
<td>Timestamp of measured value (e.g. 2015-07-15 12:00:00+0200) (mandatory)</td>
</tr>
</tbody>
</table>
Data Service
Data Service provides information about units and positions of units
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/DataService?Operation=<var>operationName</var></td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Provides detailed information about sensor units</td>
<td>JSON</td>
</tr>
</tbody>
</table>
GetUnits
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/DataService?Operation=GetUnits</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Provides detailed information about each units connected to login user. Response contains connected sensors, first and last time stamp of entered observation, last positions of units.</td>
<td>JSON</td>
</tr>
</tbody>
</table>
GetUnitsList
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/DataService?Operation=GetUnitsList</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Provides basic information about each units connected to login user. Response contains identifier of each unit and its description.</td>
<td>JSON</td>
</tr>
</tbody>
</table>
GetPositions
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/DataService?Operation=GetPositions</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Request provides users specified number of last positions of all units in current group.</td>
<td>JSON</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<th>Parameter</th>
<th>Format</th>
<th>Role</th>
</tr>
<tr>
<td>user</td>
<td>Text</td>
<td>Identifier of user group</td>
</tr>
<tr>
<td>limit</td>
<td>Numeric value</td>
<td>Number of positions to receive</td>
</tr>
</tbody>
</table>
GetPositionsDay
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/DataService?Operation=GetPositionsDay</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Request provides list of positions of specified unit during given time range. Positions can be ordered by timestamp ascending or descending. This method is variable to GetTracks, but providing raw positions as Points rather than tracks as Polylines.</td>
<td>JSON</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<th>Parameter</th>
<th>Format</th>
<th>Role</th>
</tr>
<tr>
<td>user</td>
<td>Text</td>
<td>Identifier of user group. (mandatory)</td>
</tr>
<tr>
<td>unit_id</td>
<td>Numeric value</td>
<td>Identifier of unit. (mandatory)</td>
</tr>
<tr>
<td>fromTime</td>
<td>Date (ISO 8601)</td>
<td>Beginning date of the time range. (optional)</td>
</tr>
<tr>
<td>toTime</td>
<td>Date (ISO 8601)</td>
<td>End date of the time range. (optional)</td>
</tr>
<tr>
<td>ordering</td>
<td>Text</td>
<td>Identifier of ordering way. Only values "ascending" and "descending" are allowed. (optional)</td>
</tr>
</tbody>
</table>
GetLastPositions
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/DataService?Operation=GetLastPositions</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Request provides user last positions of all units in user group.</td>
<td>JSON</td>
</tr>
</tbody>
</table>
GetLastPositionsWithStatus
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/DataService?Operation=GetLastPositionsWithStatus</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Request provides user information about alert events and other attributes in addition to previous GetLastPositions request.</td>
<td>JSON</td>
</tr>
</tbody>
</table>
GetTracks
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/DataService?Operation=GetTracks</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Request returns entered number of trajectory geometries of all moving units in user group.</td>
<td>URL encoded text/plain</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<th>Parameter</th>
<th>Format</th>
<th>Role</th>
</tr>
<tr>
<td>limit</td>
<td>Numerical value</td>
<td>Number of tracks to receive</td>
</tr>
</tbody>
</table>
GetRecentTracks
<table>
<tbody>
<tr>
<th colspan="3">URL</th>
</tr>
<tr>
<td colspan="3">/DataService?Operation=GetRecentTracks</td>
</tr>
<tr>
<th>Method</th>
<th>Functionality</th>
<th>Format</th>
</tr>
<tr>
<td>GET</td>
<td>Request returns trajectory geometries of all moving units in user group.</td>
<td>URL encoded text/plain</td>
</tr>
</tbody>
</table>