Skip to main content
. 2020 May 14;20(10):2783. doi: 10.3390/s20102783

Table 3.

Example Format of RESTful APIs in The Gateway.

API Path Example Method Description
/api/device /api/device GET Get all devices in system
/api/device/{:id} /api/device/1 GET Get information of device with id = 1
/api/device/light/:id/{:command} /api/device/light/1/on POST Turn on device (light) with id = 1
/api/device/light/:id/{:command} /api/device/light/1/color POST Set color for device (light) with id = 1
/api/device/security/:id/{:command} /api/device/lock/3/unlock POST Unlock device (lock) with id = 3