Create an event

Create an event with timestamp.

URI
/deviceEvent/create/{deviceKey}/{event}
Method
GET

URI parameters

deviceKey
The device key
event
The event name (maximum 32 characters)

Request headers

Request body

Response body

200 The value
value
403 Device not found by key

                            

List events

Retrieve the last 100 events order by creation timestamp descending.

URI
/deviceEvent/list/{deviceShortId}
Method
GET

URI parameters

nodeKey
The node key
key
The value key

Request headers

Access token (optional)
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The list of events
[
  {
    "created":1590931792372,
    "deviceId":"61c707f0-46c7-11e8-a240-7bca10e5bd5b",
    "deviceShortId":"okB7yhDlvVthxwfwRscR6A",
    "type":"eventOff",
    "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935",
    "userShortId":"lL090xDnGTVMpv9BRAgR6A"
  },
  {
    "created":1590931779278,
    "deviceId":"61c707f0-46c7-11e8-a240-7bca10e5bd5b",
    "deviceShortId":"okB7yhDlvVthxwfwRscR6A",
    "type":"eventOn",
    "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935",
    "userShortId":"lL090xDnGTVMpv9BRAgR6A"
  }
]
403 Device not found by short id, not visible or the credential is invalid