Check in

Update the last check date of the device.

URI
/firmware/check/{deviceKey}
Method
GET

URI parameters

deviceKey
The key of the device

Request headers

Request body

Response body

200 The database has been updated

                            
404 Device not found by key

                            

Check in

Report the current version; check for the new firmware version of the device.

URI
/firmware/check/{deviceKey}/{version}
Method
GET

URI parameters

deviceKey
The key of the device
version
The version of the device

Request headers

Request body

Response body

200 The database has been updated; new firmware available for update

                            
304 The database has been updated; no new firmware

                            
404 Device not found by key

                            

Check in

Report the current version and IP address; check for the new firmware version of the device.

URI
/firmware/check/{deviceKey}/{version}/{ip}
Method
GET

URI parameters

deviceKey
The key of the device
version
The version of the device
ip
The IP address of the device

Request headers

Request body

Response body

200 The database has been updated; new firmware available for update

                            
302 The database has been updated; no new firmware

                            
404 Device not found by key

                            

List

List the firmwares of the user.

URI
/firmware/list
Method
GET

URI parameters

Request headers

Access token
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The list of the firmwares
[  
   {  
      "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935",
      "version":"0.1.18-0",
      "created":1524559137817
   },
   {  
      "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935",
      "version":"0.1.18-1",
      "created":1524569662086
   }
]
401 The provided JWT access token is invalid or expired

                            

Update

Get the latest firmware binary if it is newer than the reported.

URI
/firmware/update/{deviceKey}/{version}
Method
GET

URI parameters

deviceKey
The key of the device
version
The version of the device

Request headers

Request body

Response body

200 The binary firmware
[binary stream]
302 There is no new firmware

                            
404 Device not found by key or the firmware binary not uploaded yet

                            

Store

Store the specified firmware binary.

URI
/firmware/store
Method
POST
Encoding type
multipart/form-data

URI parameters

Request headers

Access token
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Binary
binary
Version
version

Response body

200 The firmware stored

                            
401 The provided JWT access token is invalid or expired

                            
404 Firmware binary or version string not found in the request