HTTP REST API

The API description is hosted on Bitbucket. Feel free to make pull requests to add, clarify, or translate it into other languages.
We highly welcome the collective work on it.

The device API is built according to the REST scheme, but is significantly simplified.

This API is universal for all devices and allows you to both manage and receive information about the state of the device via Wi-Fi. This protocol also allows using any of the LOOKin devices in existing Smart Home systems by connecting it to the controller as an HTTP device.

Please note that the developed API does not always comply with the REST scheme, this is a design error, in future versions of the API it is planned to update the API to REST compliance release by release

GET requests are used to get any information.

POST/PUT requests are used to save or change data. PUT requests cannot create data. PUT/POST requests are not available for all data, as some fields are immutable. This requests should be sent as JSON in the body of the message.

Requests must be interpreted regardless of the closing slash “/”. When interpreted, all request URIs are lowercase.

When checking the parameter keys to match them, both the internal name and the name passed to the API must be lowercase.

For example, requests seems like "/Device/" or "/device/" during parsing will be converted to the following form: "/device".

Request with this form

POST /Device 
{ "Name" : "Kitchen light"}

Will be interpret as:

POST /device 
{ "name" : "Kitchen light" }

All fields of the first-level object, in this case “name”, are additionally transferred to the requests inside the device as parameters, along with the parameters of the GET request, separated by &. This leads to the fact that for the device the list of parameters of the following queries is equivalent:

GET /device?name=Торшер
POST /Device { "Name" : "Торшер"}

Used query types:

GET - get information from endpoint or made simple action  
POST - update or set information 
DELETE - remove object or parameter

Answer codes:

200 - OK  
400 - Some mistake in query  
500 - Inner device error

All requests must be sent with Content-Type: Charset = UTF-8!

Device UDP basics

The UDP server built into the device listens on port 61201. In the case if you send a packet from another port, the device will remember the sender port and will also send packets to this port when sending broadcast messages. In total, the device can store up to 10 additional ports, and when message will be received from 11-th port, the first saved one will be overwritten.

/device

/network

Network endpoints designed to store, receive and display network information.

/automation

Documentation not ready yet

/storage

Documentation not ready yet

/sensors

/commands

/log

Documentation not ready yet

/data

Quick access