Reference
RESTful API and XML (V5)
Commands to switch relays, read inputs, sensors and hour meters, and change bell schedules from your own software, plus the XML pages you can read data from.
01How the API Works
Every Linortek device has a simple RESTful API that you can call from a browser, a script or your own software.
- Address: every command starts with
http://<IP>/api/, where<IP>is your device’s IP address (add:<port>if the device uses a port other than 80). - Method: send every command as an HTTP GET request. Any data the command needs is part of the URL.
- Result: HTTP status 200 means success. Treat any other status code as an error.
- Returned data: not every command returns data. Commands that do wrap it in a tag named after the data, in the form
<data_name>data</data_name>. The bell schedule commands return JSON.
For example, to turn on relay 1 of a device at 192.168.1.100, open this address:
Or from a command line:
Find your device’s IP address with the free Discover program.
Authentication
If Use RESTful Authentication is checked on the device’s settings page, every command must include the device’s user name and password using HTTP Basic Authentication. For example:
If the box is unchecked, commands work without a login.
02Relay Outputs
For FARGO, KODA and Ultra 300. Replace <n> with the relay number, for example 1.
| Action | Command |
|---|---|
| Turn a relay on | http://<IP>/api/relay/<n>/on/ |
| Turn a relay off | http://<IP>/api/relay/<n>/off/ |
| Read a relay’s state | http://<IP>/api/relay/<n>/getstate/ |
03Digital Inputs
For FARGO and KODA. Replace <n> with the input number.
| Action | Command |
|---|---|
| Read an input’s state | http://<IP>/api/digital/<n>/getstate/ |
To read all inputs at once, use the instat.xml page.
04Temperature and Humidity
For FARGO, KODA and Ultra 300 with the optional temperature/humidity sensor connected.
| Action | Command |
|---|---|
| Read the temperature | http://<IP>/api/sensor/temperature/ |
| Read the humidity | http://<IP>/api/sensor/humidity/ |
05Hour Meters
For the iTrixx-NHM (software Rev. 0.427 or later) and the iTrixx-Ultra 300 (software v0.048 or later).
| Action | Command |
|---|---|
| Read meter 1 | http://<IP>/api/hourmeter/1/getcount |
| Read meter 2 | http://<IP>/api/hourmeter/2/getcount |
For all hours in one file, use the hours.xml page.
06Time Zone and Restart
For Netbell, FARGO and KODA with software v0.448 or later.
| Action | Command |
|---|---|
| Change the time zone | http://<IP>/api/timezone/<time zone> |
| Restart the device | http://<IP>/api/reset/1/ |
Enter the time zone the same way as in the Time Zone box on the Settings – Time/Date page, for example -5 for US Eastern time.
07Bell Schedules
For the Netbell-Ultra 300 with software v0.071 or later. Use these commands to switch between schedules, for example between a normal day and a late-start day.
List the Schedules
Returns a JSON list with one entry per schedule:
| Field | Meaning | Example |
|---|---|---|
idx |
The schedule’s number, used to switch to it | 0 |
name |
The schedule’s name | "1st schedule" |
desc |
The schedule’s description | "test description 1" |
active |
true for the schedule that is running now |
true |
Full example: {"schedules": [{"idx": 0, "name": "1st schedule", "desc": "test description 1", "active": true}, {"idx": 1, "name": "2nd sch", "desc": "test string 2", "active": false}]}
Switch to a Schedule
Replace <idx> with the schedule’s number from the list:
If it worked, it returns {"error": false, "status": "success"}.
08XML Pages
These pages return the device’s current data as XML. Open them in a browser or read them from your own software.
| Device | Data | Address |
|---|---|---|
| FARGO, KODA, Ultra 300 | Input states | http://<IP>/p/instat.xml |
| iTrixx-NHM, iTrixx-Ultra 300 | Hours | http://<IP>/hours.xml |
| iTrixx-NHM, iTrixx-Ultra 300 | Hour details | http://<IP>/hourdetail.xml |
| iTrixx-NHM, iTrixx-Ultra 300 | Input states | http://<IP>/p/instat.xml |
| iTrixx-WFMN-Di and WFMN-ADi (software v0.62.8 or later) | Hours, with the G value (impact) | http://<IP>/hours.xml |
09More Information
For wiring, settings and the free data collection apps, see the user manual for your device on the Manuals page, or the Video Tutorials. For help with the API, contact Linortek tech support or call 336-485-6199.
Still stuck? Our support team can help with setup and configuration.
