Hi, we want to read the events listed in “event tab” for each aikaan device. Can you help us with that? Could you please share the API details of the same?
Hi,
The API to get events is below:
/es/api/es/v1/events
BTW, most of the API documentation is available on the controller at the path /api-doc
For example
https://experience.aikaan.io/api-doc/
1 Like
Hello joydeep1,
The event API details are as follows:
URL - /api/es/v1/events?limit=20&offset=0
Method - POST
Request payload -
{
"deviceid": ["string"],
"eventtype": [0],
"severity": [0],
"tags": [{}],
"tstart": 0,
"tend": 0
}
Example -
{
"deviceid": ["2521fd36-4222-4025-9b39-b1cb8eedf926"],
"eventtype": [31],
"severity": [4],
"tags": [{
"hotspot_state": "up"
}],
"tstart": 1602242706,
"tend": 1604921106
}
eventtype and severity here are enums.
You can get the enums for eventtype through the following API:
URL - /api/es/v1/eventlist
Method - GET
For severity, the enum is as follows:
const (
EV_SEVERITY_SUCCESS = 0
EV_SEVERITY_INFO = 1
EV_SEVERITY_WARNING = 2
EV_SEVERITY_ERROR = 3
EV_SEVERITY_FATAL = 4
)
1 Like