Changes
Jump to navigation
Jump to search
1,192 bytes added
, 08:43, 16 January 2022
API works through HTTP GET request, so you can work with your Larnitech server from browser, just sending requests from address string.
Request:
<syntaxhighlight lang="xml" line>
http://IPADDR:PORT/JSON_REQUEST
</syntaxhighlight>
Where:
IPADDR – ip address of your metaforsa or DE-MG;
PORT – port for API plugin (you can get it from LT Setup=>Plugins=>API=>Configure button);
JSON_REQUEST – request to server in json format.
Fields of JSON_REQUEST:
<ul>
<li>"requestType" - Type of request:
<ul>
<li>“getDevicesList” – request for getting the list of all devices;</li>
<li>“getDeviceStatus” – request for getting device status;</li>
<li>“setDeviceStatus” – request for setting device status;</li>
<li>“setDeviceStatusRaw” – request for setting device status (status in hex format);</li>
<li>“getAllDevicesStatus” – request for getting all devices status.</li>
</ul>
</li>
<li>“key” – key for API plugin (you can get it from LT Setup=>Plugins=>API=>Configure button).</li>
<li>“addr” – address of device.</li>
<li>“status” – status of device.</li>
</ul>
Examples of requests and responses:
editor, translation-admin, translator