Skip to content

System generated emit events web-socket api

  • Emit event of the websocket.

Request Method: POST

URL

/api/system-api/user-path/emit-event-ws

Request payload

  • The below is the payload of execute single web-socket event.
{
    "name": "Event_name",
    "eventData": {
        "some": "data"
    }
}
  • The below is the payload of execute multiple web-socket event.
[
    {
        "name": "ws_event_name_1",
        "eventData": {
            "some": "data"
        }
    },
    {
        "name": "ws_event_name_2",
        "eventData": {
            "some": "data"
        }
    }
]

Emit event web-socket System API

Emit event of websocket using global object 'g'.

await g.sys.system.emitEventWS("EVENT_NAME", "EVENT_DATA");
1
2
3
4
await g.sys.system.emitEventWS(
    "myEvent", 
    { "name": "Bob" }
);