{"mock":"https://private-anon-d772292354-cubeos.apiary-mock.com/","production":"http://api.incube.space/","proxy":"https://private-anon-d772292354-cubeos.apiary-proxy.com/"}
FORMAT: 1A HOST: api.incube.space # cubeOS API reference cubeOS is a smart office platform developed by [Incube](http://www.incube.space). # Group Users ## List users [/users] Returns a list of all users in the space and their details. ### getUsers [GET] + Response 200 (application/json) [ { "company": "TCV", "email": "danilo@techcity.ventures", "first_name": "Danilo", "id": 1, "in_space": false, "last_access": null, "last_name": "Orlando", "role": "SUPERADMIN", "username": "daniloTCV" } ] # Group Hubs ## Create and list hubs [/hubs] ### createHub [POST] Create a new hub device. + Request (application/json) { "name": "001788675d8c", "ip": "192.168.1.95", "controller_name": "PhilipsHue" } + Response 200 (application/json) [ { "_key": "KisiCentral", "auth": { "id": 740531, "token": "e9f898cf947489f9313c7ac187c52428" }, "controller_name": "Kisi", "ip": "https://api.getkisi.com", "name": "KisiCentral" }, { "_key": "001788675d8c", "auth": { "username": "qppQvpNdbkrVyi8spjSBR3A2MiFh9bAJ6zZsFynw" }, "controller_name": "PhilipsHue", "ip": "192.168.1.95", "name": "001788675d8c" } ] ### listHub [GET] Returns a list of all connected hubs in the space. + Response 200 (application/json) [ { "_key": "KisiCentral", "auth": { "id": 740531, "token": "e9f898cf947489f9313c7ac187c52428" }, "controller_name": "Kisi", "ip": "https://api.getkisi.com", "name": "KisiCentral" }, { "_key": "001788675d8c", "auth": { "username": "qppQvpNdbkrVyi8spjSBR3A2MiFh9bAJ6zZsFynw" }, "controller_name": "PhilipsHue", "ip": "192.168.1.95", "name": "001788675d8c" } ] ## Discover hub [/hubs/discovery] ### discoverHub [POST] + Request (application/json) { "controller_name": "PhilipsHue" } + Response 200 (application/json) ## Get and send hub commands [/hubs/{name}/commands] + Parameters + name - Name of the Hub. Example: `KisiCentral` ### getHubCommands [GET] + Response 200 (application/json) { "hub": [ "register_user_on_hub", "get_devices", "set_device_state" ], "services": [], "users": [] } ### sendHubCommand [POST] + Request (application/json) { "command": "get_devices", "device_type": "light" } + Response 200 (application/json) ## Get hub info [/hubs/{name}] Does not work. + Parameters + name - Name of the Hub. Example: `KisiCentral` ### getHubInfo [GET] + Response 200 (application/json) # Group Devices ## Create and list devices [/devices] Need description ### createDevices [POST] Add a new device. + Request (application/json) { "name":"TestLamp1DOWN", "hub_device_id":"2", "zone_name":"TestZone", "category":"light", "group_name":"test", "model_reference":"T1010" } + Response 200 (application/json) [ { "_key": "1", "active": true, "category": "light", "group_name": "test", "hub_device_id": "1", "ip": "", "location": {}, "model_reference": "T1010", "name": "TestLamp1Down", "zone_name": "TestZone" }, { "_key": "2", "active": true, "category": "light", "group_name": "test", "hub_device_id": "2", "ip": "", "location": {}, "model_reference": "T1010", "name": "TestLamp1Up", "zone_name": "TestZone" }, { "_key": "3", "active": true, "category": "lock", "group_name": "test_doors", "hub_device_id": "7092", "ip": "", "location": {}, "model_reference": "K9000", "name": "TestDoor", "zone_name": "TestZone" } ] ### getDevices [GET] Returns a list of all devices in the space. + Response 200 (application/json) [ { "_key": "1", "active": true, "category": "light", "group_name": "test", "hub_device_id": "1", "ip": "", "location": {}, "model_reference": "T1010", "name": "TestLamp1Down", "zone_name": "TestZone" }, { "_key": "2", "active": true, "category": "light", "group_name": "test", "hub_device_id": "2", "ip": "", "location": {}, "model_reference": "T1010", "name": "TestLamp1Up", "zone_name": "TestZone" }, { "_key": "3", "active": true, "category": "lock", "group_name": "test_doors", "hub_device_id": "7092", "ip": "", "location": {}, "model_reference": "K9000", "name": "TestDoor", "zone_name": "TestZone" } ] ## Get device status [/devices/status] Extensive information about device activity and functioning. ### getDeviceStatus [GET] + Response 200 (application/json) [ { "_key": "3", "active": true, "category": "lock", "extended_info": { "Error": "Missing function to retrieve Info" }, "group_name": "test_doors", "hub_device_id": "7092", "ip": "", "location": {}, "model_reference": "K9000", "name": "TestDoor", "zone_name": "TestZone" } ] ## Get and modify device information [/devices/{id}] + Parameters + id - Device id. Example: `3` ### getDevice [GET] Does not work + Response 200 (application/json) ### modifyDevice [PUT] Does not work + Request (application/json) { "name":"TestLamp1Up" } + Response 200 (application/json) ## List and create device managers [/device_managers] ### getDeviceManagers [GET] + Response 200 (application/json) [ { "_key": "1", "device_hub_reference": "001788675d8c", "device_id": "1", "info": {}, "polling": false, "polling_active": false, "update_frequency": 0 }, { "_key": "2", "device_hub_reference": "001788675d8c", "device_id": "2", "info": {}, "polling": false, "polling_active": false, "update_frequency": 0 }, { "_key": "3", "device_hub_reference": "KisiCentral", "device_id": "3", "info": {}, "polling": false, "polling_active": false, "update_frequency": 0 } ] ### createDeviceManager [POST] + Request (application/json) { "device_id":"2", "device_hub_reference":"001788675d8c" } + Response 200 (application/json) [ { "_key": "1", "device_hub_reference": "001788675d8c", "device_id": "1", "info": {}, "polling": false, "polling_active": false, "update_frequency": 0 }, { "_key": "2", "device_hub_reference": "001788675d8c", "device_id": "2", "info": {}, "polling": false, "polling_active": false, "update_frequency": 0 }, { "_key": "3", "device_hub_reference": "KisiCentral", "device_id": "3", "info": {}, "polling": false, "polling_active": false, "update_frequency": 0 } ] ## Get device manager [/devices/{id}/manager] Returns a list of device managers in the space. + Parameters + id - Device id. Example: `3` ### getDeviceManager [GET] + Response 200 (application/json) { "_key": "3", "device_hub_reference": "KisiCentral", "device_id": "3", "info": {}, "polling": false, "polling_active": false, "update_frequency": 0 } ## Create and list device catalogue [/catalogue] ### getDeviceCatalogue [GET] Does not work. + Response 200 (application/json) ### createDeviceCatalogue [POST] Add a new device to the device catalogue. + Request (application/json) { "id": "T1011", "category": "light", "controller_name": "PhilipsHue", "type": "Desktop Lamp", "data": { "manufacturer": "Philips", "model": "LLM001" } } + Response 200 (application/json) { "_key": "T1011", "category": "light", "controller_name": "PhilipsHue", "data": { "manufacturer": "Philips", "model": "LLM001" }, "id": "T1011", "type": "Desktop Lamp" } # Group Controller ## Get device controller [/controllers?name={name}] Lists all details of the targeted device controller. + Parameters + name - Name of the controller. Example: `PhilipsHue` ### getController [GET] + Response 200 (application/json) [ { "_key": "PhilipsHue", "controller_type": "Local Hub", "model": "Philips Hue 2015 ", "name": "PhilipsHue", "native_group_support": true, "params": { "api_version": 1, "app_id": "CubeOS/server", "discoverable": true, "max_calls_per_sec": 10 } } ]