This FAQ describes how to use 2N® Indoor Touch HTTP API on a device, how to configure it. 2N® Indoor Touch HTTP API is an application interface designed for control of selected 2N® Indoor Touch functions via the HTTP commands. It enables 2N® Indoor Touch to be integrated easily with third party products, such as home automation, security and monitoring systems, etc.
Tips&Tricks at the beginning
Here is an example how you can change parameters of the 2N® Indoor Touch device via HTTP API. In manual you will find all commands for a device.
- Communication is made via the HTTPS protocol, which runs on standardised port 443. Authentication requires login and password data to be transmitted in the first connection.
- The HTTP API license is needed to enable this feature support. Order number of the HTTP API license is 91378395.
How to use HTTP API on the 2N® Indoor Touch
- There are two possibilities how to access to HTTP API. You can use your application or any web browser.
For a demonstration we will use an application Postman. User needs to authenticate wit login command. For login you need to use PUT method. After authentication use any commands from manual with GET method.
- Second option is to use a web browser. Connect to the 2N® Indoor Touch, use your username and password to log in. It is important for authentication. Without login will HTTP API not work. For more information please follow the manual. https://faq.2n.cz/display/ICUAPI12EN/4.1+Interface
- After the authentication, you can use different commands. Structure of a command must be like this:
- IP is the 2N® Indoor Touch IP address
- <subsystem> designates the system part to be controlled
- <parameters> includes request details
How to switch IO on the 2N® Indoor Touch via HTTP API
- After you log in to the device. Use the special HTTP API command to switch relay.
- structure of the command is https://<IP>/api/v1/gpio?action=set&name=<string>&type=<string>&value=<bit>, where you will define name, type and value
How to activate door lock in application 2N® Helios IP via HTTP API
After you log in to the device add your 2N® Helios IP Mobile intercom to 2N® Helios IP Mobile application.. You can do it both ways from the web browser or from the application.
Use the special HTTP API command to active a door lock in 2N® Helios IP Mobile application. Part of the command is a serial number of a saved device and ID of the switch that you would like to use.