API works via WebSocket connection, so you can interact with your Larnitech server from a browser using extensions (such as WebSocket Test Client).<br>
+
API works via WebSocket connection, so you can interact with your Larnitech server from a browser using extensions (such as WebSocket Test Client).<br><br>
To get started, you should:<br>
To get started, you should:<br>
−
1. Establish a web socket connection.
+
1. Establish a web socket connection.
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
ws://IPADDR:PORT/api
ws://IPADDR:PORT/api
Line 10:
Line 10:
Where:
Where:
IPADDR – ip address of your metaforsa or DE-MG;
IPADDR – ip address of your metaforsa or DE-MG;
−
PORT – port for API2 (you can get it from LT Setup=>General=>API=>Websocket port (2041 by default);<br>
+
PORT – port for API2 (you can get it from LT_Setup => General => API => Websocket port (2041 by default);<br><br>
−
2. Authorize
+
2. Authorize
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
Line 18:
Line 18:
}
}
</syntaxhighlight>
</syntaxhighlight>
−
Where XXXXXXXXXXXXXXX - LT Setup=>Security=>Show API key<br>
+
Where XXXXXXXXXXXXXXX - key from LT_Setup => Security => Show API key<br><br>