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
Definition
GET /devices
Response
200 OKon success
[
{
"identifier": "floor-lamp",
"name": "Floor Lamp",
"device_type": "switch",
"controller_gateway": "192.168.0.2"
},
{
"identifier": "vizio-tv",
"name": "Living Room TV",
"device_type": "tv",
"controller_gateway": "192.168.0.9"
}
]Definition
POST /devices
Arguments
"identifier":stringa globally unique identifier for this device"name":stringa friendly name for this device"device_type":stringthe type of the device as understood by the client"controller_gateway":stringthe IP address of the device's controller
If a device with the gien indentifier already exists, the existing device will be overwritten.
Response
201 Createdon success
{
"identifier": "floor-lamp",
"name": "Floor Lamp",
"device_type": "switch",
"controller_gateway": "192.168.0.2"
}GET /device/<identifier>
Response
404 Not Foundif the device does not exist200 OKon success
{
"identifier": "floor-lamp",
"name": "Floor Lamp",
"device_type": "switch",
"controller_gateway": "192.168.0.2"
}Response
404 Not Foundif the device does not exist204 No Contenton success