Update User Terminal authored by Jan Janak's avatar Jan Janak
......@@ -278,3 +278,23 @@ curl http://<hostname>:<port>/api/events
"event" : "ptt.release"
}]
```
Each event is uniquely identified by a pair <timestamp,id> (timestamps can be duplicate). The attribute "event" identifies the event. An optional attribute "data" can carry additional information in the form of a JSON object.
To obtain events in a specific time interval, the client can add query string parameters 'from' and 'until' to the URL:
```sh
curl http://<hostname>:<port>/api/events?from=2020-04-15T16:00:21.032Z&until=2020-04-15T16:00:25.049Z
```
```json
[{
"id" : 2,
"timestamp" : "2020-04-15T16:00:21.032Z",
"event" : "ptt.press"
}, {
"id" : 3,
"timestamp" : "2020-04-15T16:00:25.049Z",
"event" : "ptt.release"
}]
```
The values must be in the ISO 8601 timestamp format and are inclusive.
To delete events stored at a terminal, e.g., after they have been transferred to the base station, the client can send a HTTP DELETE request to `/api/events`. Without the query string, all events stored at the terminal will be deleted. Use the query string parameters 'from' and 'until' (see above) to only delete events in the specified time range.
\ No newline at end of file