smartDEN
IP-16R-MT
User Manual
7 July 2020
-
32
-
8. HTTP/XML/JSON access
This operation mode allows custom applications to control the
smartDEN IP-16R-
MT
without using a Web-browser. The custom application acts as a HTTP client,
sending HTTP GET requests to the
smartDEN IP-16R-MT
.
To receive the current state of the
smartDEN IP-16R-MT,
the application requests
the page
current_state.xml (current_state.json)
, for example:
http://192.168.1.100/current_state.xml
http://192.168.1.100/current_state.json
The custom application can also control the
smartDEN IP-16R-MT
by sending
parameters (name/value pairs) with the HTTP/XML/JSON GET request, for example:
http://192.168.1.100/current_state.xml?Relay=1&Relay2=0&Relay3=1
http://192.168.1.100/current_state.json?Relay=1&Relay2=0&Relay3=1
The XML/JSON login process differs depending on the selected
Encrypt
Password
option.
8.1. Login (Encrypted Password)
In this mode a two-step login sequence is provided as a protection against
unauthorized access. The first time the custom application requests the page
current_state.xml / current_state.json
, a random login key is issued in the reply. Next
the custom application uses this key to encrypt the password. The encrypted
password is sent as a parameter with the next request to the page
current_state.xml /
current_state.json
.
Bellow is an example of login process:
Step 1:
Request
http://192.168.1.100/current_state.xml
Reply (login required):
<CurrentState>
<LoginKey>65156</LoginKey>
</CurrentState>
http://192.168.1.100/current_state.json
Reply (login required):
{"CurrentState": {"LoginKey": "65156"}}