Different views for Websocket API request

Options

Is it possible to have a different view in the request for different ric's? Like:

{
"ID": 2,
"Key": {
"Name": "EUR="
},
"View": [
"PRIMACT_1",
"CTBTR_1",
"QUOTE_DATE"
]
},

{
"ID": 3,
"Key": {
"Name": "CZ0"
},
"View": [
"SETTLE",
"SETTLEDATE"
]
}

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @3352edee-c7b3-42de-95ff-77348a2fc138_deprecated_0bbe7cc3-29e3-4fb6-9839-cd518b6f430b

    Yes, it is possible. Each item request message can has a different view.

    Example from market_price.py:

    req_msg = '[{"ID":2,"Key":{"Name":"EUR="},"View":["PRIMACT_1","CTBTR_1","QUOTE_DATE"]},{"ID":3,"Key":{"Name":"CZ0"},"View":["SETTLE","SETTLEDATE"]}]'
    ws.send(json.dumps(json.loads(req_msg)))

    Example results: result.txt

    The RIC CZ0 has a few updates but it still receives a refresh message with fields "SETTLE" and "SETTLEDATE".

    Please note that you can test and verify the Elektron WebSocket JSON request message with your local ADS server (3.2.1 and above) with the WebSocket API Try it Now! Documentation. The documentation is available Elektron WebSocket API download page. You can find more detail about this tool and Elektron WS JSON at Elektron WebSocket API Quick Start - Connecting to TREP page.

Answers