IOTV protocol
Introduction
IOTV is a simple http/https protocol for processing IOT messages and commands
In the Onebrella service, port 7746 is allocated for the IOTV protocol (for https connection - 7745).
![Select type from the menu](/nimg/blog/en_a4_title.png)
HTTP header
All requests by IOTV protocol should contain "iotv-user"in the request header. If IOTV password is not setup in the user setting, you can omit "iot-password" in the header.
![Define headers in the IoT panel](/nimg/blog/en_a4_header.png)
Mandatory attribute
All requests should contain mandatory attribute "root".
![Define root topic and parameters](/nimg/blog/en_a4_root.png)
Optional attributes
You can add the "time" attribute to the request. It must be set in UNIX STAMP format (the number of seconds from January 1, 1970 GMT + 0). If this attribute is omitted, the event time is set as a time of request processing. All other attributes depend on your IOT object. In response, you get current values of all attributes in an object.
Examples
GET
Request: https://onebrella.eu:7746/?root=HOME&A1=5&B1=12
Response: A1=5&B1=12&C1=14
POST
Request: https://onebrella.eu:7746/
JSON
Data: {"A1":"12","root":"HOME","B1":"44"}
Response: {"A1":"12","B1":"44","C2":"12"}
XML
Data: <req><A1>73</A1><root>HOME</root><B1>87</B1></req>
Response: <resp><A1>73</A1><B1>87</B1><D1>88</D1></resp>
POST FORM
Data: A1=543&root=HOME&B1=12&
Response: command=12.4&A1=543&B1=12&C1=14
Commands in responses
You can define a command for IOTV object:
![Prepare commands](/nimg/blog/en_a4_command.png)
In this case, when you enter the command it will be sent in response:
![Send commands](/nimg/blog/en_a4_send.png)
Example of responses in this case
GET
Request: https://onebrella.eu:7746/?root=HOME&A1=5&B1=12
Response: command=12.4&A1=5&B1=12&C1=14
POST
Request: https://onebrella.eu:7746/
JSON
Data: {"A1":"12","root":"HOME","B1":"44"}
Response: {"command":"12.4","A1":"12","B1":"44","C2":"12"}
XML
Data: <req><A1>73</A1><root>HOME</root><B1>87</B1></req>
Response: <resp><command>12.4</command><A1>73</A1><B1>87</B1><D1>88</D1></resp>
POST FORM
Data: A1=543&root=HOME&B1=12&
Response: command=12.4&A1=543&B1=12&C1=14