Difference between revisions of "Translations:API/1/ru"

From Larnitech wiki page
Jump to navigation Jump to search
(Created page with "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" li...")
(No difference)

Revision as of 08:43, 16 January 2022

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (API)
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=&gt;Plugins=&gt;API=&gt;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=&gt;Plugins=&gt;API=&gt;Configure button).</li>
  <li>“addr” – address of device.</li>
  <li>“status” – status of device.</li>
</ul>
Examples of requests and responses:
TranslationAPI 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=&gt;Plugins=&gt;API=&gt;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=&gt;Plugins=&gt;API=&gt;Configure button).</li>
  <li>“addr” – address of device.</li>
  <li>“status” – status of device.</li>
</ul>
Examples of requests and responses:

API works through HTTP GET request, so you can work with your Larnitech server from browser, just sending requests from address string. Request:

1http://IPADDR:PORT/JSON_REQUEST

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:

  • "requestType" - Type of request:
    • “getDevicesList” – request for getting the list of all devices;
    • “getDeviceStatus” – request for getting device status;
    • “setDeviceStatus” – request for setting device status;
    • “setDeviceStatusRaw” – request for setting device status (status in hex format);
    • “getAllDevicesStatus” – request for getting all devices status.
  • “key” – key for API plugin (you can get it from LT Setup=>Plugins=>API=>Configure button).
  • “addr” – address of device.
  • “status” – status of device.

Examples of requests and responses: