Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • DSS /
avatar image
Question by filip.balas · Sep 13, 2016 at 03:54 AM · instrumentlistsimportfrombytes

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:

https://hosted.datascopeapi.reuters.com/RestApi.Help/Context/Operation?ctx=Extractions&ent=InstrumentList&opn=ImportFromBytes

Thanks for any remarks.

Filip

People who like this

0 Show 1
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Troy Dalldorf · Sep 13, 2016 at 09:39 AM 0
Share

Not including import and export examples was an oversight on our part. We have scheduled to include these examples in the 10.8 release.

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by veerapath.rungruengrayubkul · Sep 13, 2016 at 04:57 AM

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" }
Comment
Troy Dalldorf

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by Christiaan Meihsl · Sep 13, 2016 at 05:28 AM

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.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by filip.balas · Sep 13, 2016 at 06:04 AM

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.

Comment

People who like this

0 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Christiaan Meihsl ♦♦ · Sep 13, 2016 at 07:09 AM 0
Share

Thank you for pointing this out. The typo issue has been escalated to the relevant team.

avatar image
REFINITIV
Answer by Christiaan Meihsl · Sep 13, 2016 at 07:58 AM

@filip.balas

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.

Comment
filip.balas
Troy Dalldorf

People who like this

2 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
filip.balas · Sep 13, 2016 at 10:31 AM 0
Share

Exactly crossed my mind when I moved to Extraction part. Thank You.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
6 People are following this question.
  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges