Can I get a C# example to do request/response over TREP using the EEP service.
I was successfully able to integrate the Websocket API in my project but there are some use cases that require some more thought. I would like to know the best way to retrieve data using Request/Response over TREP. I am currently using C# to make this request. Can someone point me to such an example?
Best Answer
-
Hello @ahmad.siddiqi, You can download the samples package from Elektron SDK downloads page. In the WebSocket API Sample Applications download, there are examples of MarketPrice, MarketByPrice and MarketByOrder etc in C#.
Please note that websockets have to be enabled in your TREP infrastructure (on ADS).
0
Answers
-
This is fine but isn't there a way to do simple request/response to get data or is the only way to get data is by doing a WebSocket call? Is there another api I can hit over TREP to request some data instead of writing a complicated WebSocket wrapper?
0 -
There is an Elektron SDK available in both C++ and Java only. The SDK will allow you to use API to get the data. You can follow step by step tutorials for these in the developers portal. I may apprise you, that while SDK is better suited for low latency, high volume data, it is also complex to use compared to Websocket API - which is based on simple JSON format.
0 -
Thanks for the quick response. Do you have a C# example of EMA and ETA? How do people typically use C# for communicating through these channels?
0 -
Sorry, only C++ and Java are supported API for EMA or ETA.
0 -
Ok thats fine. Using websockets if I request data in a batch looks to me like there is no guarantee that the data will come back in one response. Is there a way to determine when the client receives all the data requested via the batch?
0 -
In batch request, each instrument will have its own stream, identified by ID. See the batch request sample and these articles:
https://developers.refinitiv.com/content/elektron-websocket-api-tutorials-batch-request
https://developers.refinitiv.com/article/understanding-elektron-websocket-api-batch-and-view-feature
0 -
As well as my colleagues explanation of how each item in a Batch has its own stream ID, there is alternative simpler technique you could use to confirm if you have received a response for all items.
If you look at my Python Websocket example on Github, you will note that when the number of RefreshMsg + Closed status responses = the number of items in my batch, then I mark this as all items responded to. If you are using Streaming requests (rather than Snapshot), then you can expect to continue receiving UpdateMsgs in line with market activity for your subscribed instruments.
# Cleanup and exit - if autoExit and we have received response to all requests
if (autoExit and (reqCnt==imgCnt+closedCnt)):
cleanup(ws)So, for all valid subscription requests you should receive a RefreshMsg. For any invalid requests e.g. invalid RIC or items you are not permissioned for, you would receive a StatusMsg with a Suspect State (as demonstrated in my code).
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛