InstrumentListsImportFromBytes request example

Hello,
I can't get /Extractions/InstrumentListsImportFromBytes working. Geting 400 Bad request all the time. I was not able to find any example for this method - example request would be helpful I guess.
API documentation says byte[] but there's no encoding mentioned, so I've asumed Base64. Here's my request:
{"FileBytes":"XXX==","Settings":{"ImportCreatedUserInstrumentsIntoList":true,"PredefinedAction":"Add","AllowDuplicateInstruments":true,"PredefinedName":"2016_09_13_09_47_39_tr_instrumentList.csv","ImportUserInstruments":true},"FileName":"2016_09_13_09_47_39_tr_instrumentList.csv"}
I was refering to this source:
Thanks for any remarks.
Filip
Best Answer
-
It seems that the FileBytes is in Base64 format. I am able to import an instrument list which contains "RIC,SAREUR=R" string in the imported file. Below is the message.
Post: https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/InstrumentListImportFromBytes
{"FileBytes":"UklDLFNBUkVVUj1S", "Settings": {"ImportCreatedUserInstrumentsIntoList":true, "PredefinedAction":"Add", "AllowDuplicateInstruments":true, "PredefinedName":"test1", "ImportUserInstruments":true}, "FileName":"test1.csv" }
0
Answers
-
FileBytes must be in Base64 format.
If it is not (like XXX===) you will get the following error:
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
0 -
Resolved. Thank You for the answers.
Using Veerapath's working request I was able to find that the issue elsewhere.
There's a typo in the API documentation:
/Extractions/InstrumentListsImportFromBytes vs
/Extractions/InstrumentListImportFromBytes
I should have read the response more carefully.
0 -
Thank you for pointing this out. The typo issue has been escalated to the relevant team.
0 -
Just a few additional thoughts:
Using this call you are storing an instrument list on the DSS server, permanently (well, until you decide to modify or delete it). This is mainly useful if you want to re-use the list later on. Storing an instrument list on the DSS server can be done in other ways, there are some examples in the tutorials here, in particular the REST API Tutorial 8 and the .Net SDK tutorial 2.
Depending on your use case, storing the list on the DSS server might not be required. Using On Demand queries you can pass the instrument list as a parameter, without storing it on the server. On Demand queries hide some of the complexity in the background, making you coding easier. To see examples of how that can be done, again refer to the tutorials here, in particular the REST API Tutorials 2 & 7, and the .Net SDK tutorials 6 & 7.
The best choice depends on what you are trying to achieve.
0 -
Not including import and export examples was an oversight on our part. We have scheduled to include these examples in the 10.8 release.
0 -
Exactly crossed my mind when I moved to Extraction part. Thank You.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 687 Datastream
- 1.4K DSS
- 621 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 4 Trading API
- 2.9K Elektron
- 1.4K EMA
- 254 ETA
- 557 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 276 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 669 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 229 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛