Down alerts

List of visible devices with down alert of the user.

URI
/device/downAlerts/{userShortId}
Method
GET

URI parameters

userShortId
The short id of the user

Request headers

Request body

Response body

200 The (filtered) JSON of the device
[
   {  
      "deviceId":"5f4936b0-46c7-11e8-a240-7bca10e5bd5b",
      "deviceShortId":"okB7yhDlvVtfSTawRscR6A",
      "alertDelay":900,
      "alertEnabled":true,
      "alertFirstTimestamp":1552208093260,
      "alertFrequency":3600,
      "alertLastTimestamp":1552720193260,
      "description":"Outside A",
      "deviceKey":"xxxxxxxxxxxxxxxxxxxxxx",
      "firmwareVersion":"0.1.19-1",
      "ip":"192.168.0.229",
      "lastCheck":1552208093260,
      "lastUpdate":1528657140376,
      "name":"Outside A",
      "reportedFirmwareVersion":"0.1.19-1",
      "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935"
   }
]

Find device

Find a device by id.

URI
/device/find/{deviceShortId}
Method
GET

URI parameters

deviceShortId
The short id of the device

Request headers

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

Request body

Response body

200 The (filtered) JSON of the device
{  
   "deviceId":"5f4936b0-46c7-11e8-a240-7bca10e5bd5b",
   "deviceShortId":"okB7yhDlvVtfSTawRscR6A",
   "alertDelay":900,
   "alertEnabled":true,
   "alertFirstTimestamp":1552208093260,
   "alertFrequency":3600,
   "alertLastTimestamp":1552720193260,
   "description":"Outside A",
   "deviceKey":"xxxxxxxxxxxxxxxxxxxxxx",
   "firmwareVersion":"0.1.19-1",
   "ip":"192.168.0.229",
   "lastCheck":1552208093260,
   "lastUpdate":1528657140376,
   "name":"Outside A",
   "reportedFirmwareVersion":"0.1.19-1",
   "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935"
}
404 Device not found or allowed to see

                            

Generate new key

Generate new key to the device.

URI
/device/generateNewKey/{deviceShortId}
Method
GET

URI parameters

deviceShortId
The id of the device

Request headers

Access token
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The (filtered) JSON of the node
{  
   "deviceId":"5f4936b0-46c7-11e8-a240-7bca10e5bd5b",
   "deviceShortId":"okB7yhDlvVtfSTawRscR6A",
   "alertDelay":900,
   "alertEnabled":true,
   "alertFirstTimestamp":1552208093260,
   "alertFrequency":3600,
   "alertLastTimestamp":1552720193260,
   "description":"Outside A",
   "deviceKey":"xxxxxxxxxxxxxxxxxxxxxx",
   "firmwareVersion":"0.1.19-1",
   "ip":"192.168.0.229",
   "lastCheck":1552208093260,
   "lastUpdate":1528657140376,
   "name":"Outside A",
   "reportedFirmwareVersion":"0.1.19-1",
   "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935"
}
401 The provided JWT access token is invalid or expired

                            
403 Device not found or not owned

                            

List of devices

List of devices of the user.

URI
/device/list
Method
GET

URI parameters

Request headers

Access token
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The (filtered) JSON of the list of devices
[  
   {  
      "deviceId":"5f4936b0-46c7-11e8-a240-7bca10e5bd5b",
      "deviceShortId":"okB7yhDlvVtfSTawRscR6A",
      "alertDelay":900,
      "alertEnabled":true,
      "alertFirstTimestamp":1552208093260,
      "alertFrequency":3600,
      "alertLastTimestamp":1552720193260,
      "description":"Outside A",
      "deviceKey":"xxxxxxxxxxxxxxxxxxxxxx",
      "firmwareVersion":"0.1.19-1",
      "ip":"192.168.0.229",
      "lastCheck":1552208093260,
      "lastUpdate":1528657140376,
      "name":"Outside A",
      "reportedFirmwareVersion":"0.1.19-1",
      "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935"
   }
]

List of devices

List of public devices of the user id.

URI
/device/listByUser/{userShortId}
Method
GET

URI parameters

userShortId
The short id of the user

Request headers

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

Request body

Response body

200 The (filtered) JSON of the list of devices
[  
   {  
      "deviceId":"5f4936b0-46c7-11e8-a240-7bca10e5bd5b",
      "deviceShortId":"okB7yhDlvVtfSTawRscR6A",
      "alertDelay":900,
      "alertEnabled":true,
      "alertFirstTimestamp":1552208093260,
      "alertFrequency":3600,
      "alertLastTimestamp":1552720193260,
      "description":"Outside A",
      "deviceKey":"xxxxxxxxxxxxxxxxxxxxxx",
      "firmwareVersion":"0.1.19-1",
      "ip":"192.168.0.229",
      "lastCheck":1552208093260,
      "lastUpdate":1528657140376,
      "name":"Outside A",
      "reportedFirmwareVersion":"0.1.19-1",
      "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935"
   }
]

List of obsoleted devices

List of public obsoleted devices of the user id.

URI
/device/obsoleted/{userShortId}
Method
GET

URI parameters

userShortId
The short id of the user

Request headers

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

Request body

Response body

200 The (filtered) JSON of the list of devices
[  
   {  
      "deviceId":"5f4936b0-46c7-11e8-a240-7bca10e5bd5b",
      "deviceShortId":"okB7yhDlvVtfSTawRscR6A",
      "alertDelay":900,
      "alertEnabled":true,
      "alertFirstTimestamp":1552208093260,
      "alertFrequency":3600,
      "alertLastTimestamp":1552720193260,
      "description":"Outside A",
      "deviceKey":"xxxxxxxxxxxxxxxxxxxxxx",
      "firmwareVersion":"0.1.19-1",
      "ip":"192.168.0.229",
      "lastCheck":1552208093260,
      "lastUpdate":1528657140376,
      "name":"Outside A",
      "reportedFirmwareVersion":"0.1.19-1",
      "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935"
   }
]

Update the device

Create a new device or update the editable fields of the device.

URI
/device/update
Method
POST

URI parameters

Request headers

Access token
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Create new device (without deviceId and deviceShortId)
{  
   "alertDelay":900,
   "alertEnabled":true,
   "alertFrequency":3600,
   "description":"Outside A",
   "firmwareVersion":"0.1.19-1",
   "name":"Outside A"
}
Update the device (with deviceId and deviceShortId)
{  
   "deviceId":"5f4936b0-46c7-11e8-a240-7bca10e5bd5b",
   "alertDelay":900,
   "alertEnabled":true,
   "alertFrequency":3600,
   "description":"Outside A",
   "firmwareVersion":"0.1.19-1",
   "name":"Outside A"
}

Response body

200 The (filtered) JSON of the created or update device
{  
   "deviceId":"5f4936b0-46c7-11e8-a240-7bca10e5bd5b",
   "deviceShortId":"okB7yhDlvVtfSTawRscR6A",
   "alertDelay":900,
   "alertEnabled":true,
   "alertFirstTimestamp":1552208093260,
   "alertFrequency":3600,
   "alertLastTimestamp":1552720193260,
   "description":"Outside A",
   "deviceKey":"xxxxxxxxxxxxxxxxxxxxxx",
   "firmwareVersion":"0.1.19-1",
   "ip":"192.168.0.229",
   "lastCheck":1552208093260,
   "lastUpdate":1528657140376,
   "name":"Outside A",
   "reportedFirmwareVersion":"0.1.19-1",
   "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935"
}
401 The provided JWT access token is invalid or expired

                            
403 Device not found or not owned