Changes
Jump to navigation
Jump to search
50 bytes added
, 08:41, 9 February 2022
m| Line 4: |
Line 4: |
| | 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> | | 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> |
| | To get started, you should: | | To get started, you should: |
| − | # Establish a web socket connection.
| + | Establish a web socket connection. |
| | <syntaxhighlight lang="xml" line> | | <syntaxhighlight lang="xml" line> |
| | ws://IPADDR:PORT/api | | ws://IPADDR:PORT/api |
| Line 11: |
Line 11: |
| | 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); | | PORT – port for API2 (you can get it from LT Setup=>General=>API=>Websocket port (2041 by default); |
| − | # Authorize
| + | Authorize |
| | + | <syntaxhighlight lang="json" line> |
| | { | | { |
| | "request": "authorize", | | "request": "authorize", |
| | "key": "XXXXXXXXXXXXXXX" | | "key": "XXXXXXXXXXXXXXX" |
| | } | | } |
| | + | </syntaxhighlight> |
| | Where XXXXXXXXXXXXXXX - LT Setup=>Security=>Show API key | | Where XXXXXXXXXXXXXXX - LT Setup=>Security=>Show API key |
| | After this you can send json requests: | | After this you can send json requests: |