For receiving order updates through Websockets, do we have to invoke the fyer.fyers_connect API (Nodejs) In a while loop ? currently I dont see any order updates flowing.. is there any sample NodeJS code for websockets

For receiving order updates through Websockets, do we have to invoke the fyer.fyers_connect API (Nodejs) In a while loop ? currently I dont see any order updates flowing.. is there any sample NodeJS code for websockets

From https://myapi.fyers.in/docs/#tag/Web-Socket/paths/~1WebSocket/post

const reqBody = {
dataType:‘orderUpdate’

}

fyers.fyers_connect(reqBody,function(data){
console.log(data)
//Write your code here
})


Sample Success Response

{
“s”: “ok”,
“d”: {
“orderDateTime”: 315532800,
“id”: “1210412103802”,
“exchOrdId”: “”,
“side”: 1,
“segment”: “E”,
“instrument”: “”,
“productType”: “INTRADAY”,
“status”: 5,
“qty”: 1,
“remainingQuantity”: 1,
“filledQty”: 0,
“limitPrice”: 0.0,
“stopPrice”: 0.0,
“type”: 2,
“discloseQty”: 0,
“dqQtyRem”: 0,
“orderValidity”: “DAY”,
“slNo”: 1,
“offlineOrder”: false,
“message”: “RMS:1210412103802:NSE,EQUITY,1624,IOC,
INTRADAY,EQ, FY0001,B,1,I,87.20000,
INTRADAY_SQUARE_OFF_INTIATED_ORDERS_NOT
_ALLOWED_FOR_PRODUCT_SELECTED”,
“orderNumStatus”: “1210412103802:5”,
“tradedPrice”: 0.0,
“fyToken”: “10100000001624”,
“symbol”: “NSE:IOC-EQ”
}
}