REST API

Stanag2WebRtc module includes a REST interface that allows for easy communication between different systems, using HTTP methods such as GET, POST, PUT, and DELETE. By exposing the REST interface, the Stanag2WebRtc module provides a simple and standardized way for external applications to interact with it, enabling seamless integration with other systems and applications. This makes it a powerful and versatile tool for facilitating real-time communication in a variety of settings.

Info

Returns information on the configuration and a current state of the service:

Request type GET

http://localhost:4000/info

Sample response:

{
  "activeConnections": 0,
  "channelName": "EO",
  "concurrentClients": -1,
  "demo": true,
  "demoExpired": false,
  "missionName": "Mission",
  "noKlv": true,
  "nodeInfo": "NI-MISBCORE-5BAN7HNN3MTY6HK72ESPEV4R3XBDY55EMFNQ0194DM5S5JSQAEXG:",
  "poster": "posterGray.jpg",
  "recorderEnabled": true,
  "url": "udp://227.1.1.1:30120",
  "useCapture": false,
  "version": "1.2.0",
  "videoBitrate": 4000000,
  "videoPassThrough": false,
  "videoResolution": "720x"
}

Recorder state

Returns recorder state:

Request type GET

http://localhost:4000/recorderState

Sample response:

{
  "state": "running",
  "timeStarted": "2023-05-11 15:13:43.9678858 +0000 UTC"
}

Commands

Start streaming

Request type POST

POST http://{{ host }}/command content-type: application/json Authorization: Basic {{ user }} {{ password }}

{ "service": "stanag2webrtc", "command": "start", "params": "" }

Stop streaming

Request type POST

POST http://{{ host }}/command content-type: application/json Authorization: Basic {{ user }} {{ password }}

{ "service": "stanag2webrtc", "command": "stop", "params": "" }

Exit

Exit application

Request type POST

POST http://{{ host }}/command
content-type: application/json
Authorization: Basic {{ user }} {{ password }} 

{ 
  "service": "stanag2webrtc",
  "command": "exit",
  "params":  ""
}

Start recorder

Starts recording

Request type POST

POST http://{{ host }}/command
content-type: application/json
Authorization: Basic {{ user }} {{ password }} 

{ 
  "service": "recorder",
  "command": "start",
  "params":  ""
}

Stop recorder

Stops recording

Request type POST

POST http://{{ host }}/command
content-type: application/json
Authorization: Basic {{ user }} {{ password }} 

{ 
  "service": "recorder",
  "command": "stop",
  "params":  ""
}