All responses will have the form
{
"data": "Mixed type holding the content of the response",
"message": "Description of what happened"
}
Subsequent response definitions will only detail the expected value of the data
field
##List all devices
Definition
GET /devices
Response
200 OK
on success
[
{
"identifier": "floor-lamp",
"name": "Floor Lamp",
"device_type": "switch",
"controller_gateway": "192.1.23.45"
},
{
"identifier": "samsung-tv",
"name": "Living Room TV",
"device_type": "tv",
"controller_gateway": "192.6.7.8"
}
]
Definition
POST /devices
Arguments
"identifier":string
a globally unique identifier for this device"name":string
a friendly name for this device"device_type":string
the type of the device as understood by the client"controller_gateway":string
the IP address of the device's controller
If a device with the given identifier already exists, the existing device will be overwritten.
Response
201 Created
on success
{
"identifier": "floor-lamp",
"name": "Floor Lamp",
"device_type": "switch",
"controller_gateway": "192.1.23.45"
}
GET /device/<identifier>
Response
404 Not Found
if the device does not exist200 OK
on success
{
"identifier": "floor-lamp",
"name": "Floor Lamp",
"device_type": "switch",
"controller_gateway": "192.1.23.45"
}
Definition
DELETE /devices/<identifier>
Response
404 Not Found
if the device does not exist204 No Content
on success