Changes
Jump to navigation
Jump to search
115 bytes added
, 15:21, 27 February 2024
| Line 2: |
Line 2: |
| | <translate> | | <translate> |
| | <!--T:1--> | | <!--T:1--> |
| − | API2 works via web socket requests, so you can interact with your Larnitech server from a browser using extensions (such as WebSocket Test Client).<br>
| + | (NOT WORK) |
| − | To get started, you should: | + | API also works via WebSocket connection, so you can interact with your Larnitech server from a browser using extensions (such as WebSocket Test Client).<br> |
| − | # Establish a web socket connection.
| + | To get started, you should:<br><br> |
| − | <syntaxhighlight lang="xml" line> | + | 1. Establish a web socket connection.<br> |
| | + | <syntaxhighlight lang="xml"> |
| | ws://IPADDR:PORT/api | | ws://IPADDR:PORT/api |
| | </syntaxhighlight> | | </syntaxhighlight> |
| − | Where: | + | Where: IPADDR – ip address of your metaforsa or DE-MG;<br> |
| − | 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><br> |
| − | PORT – port for API2 (you can get it from LT Setup=>General=>API=>Websocket port (2041 by default); | + | 2. Authorize |
| − | # Authorize
| + | <syntaxhighlight lang="json"> |
| | { | | { |
| | "request": "authorize", | | "request": "authorize", |
| | "key": "XXXXXXXXXXXXXXX" | | "key": "XXXXXXXXXXXXXXX" |
| | } | | } |
| − | Where XXXXXXXXXXXXXXX - LT Setup=>Security=>Show API key | + | </syntaxhighlight> |
| − | After this you can send json requests: | + | Where XXXXXXXXXXXXXXX - key from LT_Setup => Security => Show API key<br><br> |
| | + | 3.After this you can send json requests: |
| | | | |
| | Fields of JSON_REQUEST: | | Fields of JSON_REQUEST: |