For a deeper look into our DataScope Select SOAP API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
1 0 1 0

How to get all instruments by API request for a list created manually in DSS (not a count as mentioned in tutorial for API DSS )

dss-rest-apidatascope-selectdss
icon clock
10 |1500

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

1 Answer

Upvote
Accepted
13.7k 26 8 12

@stas.grinberg,

If I understand correctly, you want to use the API to retrieve the list of instruments in an instrument list stored on the server.

For this you need the instrument list ID.

Step 1: get the instrument list ID from the instrument list name

If you only have the list name, you can retrieve the ID using the GetByName call:

GET https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/InstrumentListGetByName(ListName='MyListName')

This delivers the ListId:

{
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#InstrumentLists/$entity",
"ListId": "0x066c72ea4b60201a",
"Name": "MyListName",
"Count": 2,
"Created": "2018-10-03T16:59:07.670Z",
"Modified": "2018-10-03T16:59:29.986Z"
}

Step 2: get all instruments in the instrument list stored on the server

You can use the GetAllInstruments call (replace the InstrumentList Id value by the ID of your own list):

GET https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/InstrumentLists('0x066c72ea4b60201a')/ThomsonReuters.Dss.Api.Extractions.InstrumentListGetAllInstruments

The result will contain a set of records, one per instrument. Each record contains the Identifier, IdentifierType, etc. Here is an extract of a sample output:

{
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#InstrumentListItems",
"value": [
{
"ListId": "0x066c72ea4b60201a",
"Identifier": "SARON.S",
"IdentifierType": "Ric",
"Source": "SWX",
"UserDefinedIdentifier": "",
"UserDefinedIdentifier2": "",
"UserDefinedIdentifier3": "",
"UserDefinedIdentifier4": "",
"UserDefinedIdentifier5": "",
"UserDefinedIdentifier6": "",
"Order": 4,
"Description": "SARON Swiss Average Rate ON",
"InstrumentListItemKey": "VjF8MHgwNjZjNzJlYTRiNjAyMDFhfDQ",
"InstrumentKey": "VjF8MHgwMDEwMGIwMDAzN2Y5YjhhfDB4MDAxMDBiMDAwZjVkYWIxMnxTV1h8TU5RVXxNT05ZfE1PTll8WXx8U0FST04uU3wzNjk4"
},
...
]
}

Is this what you were searching for ?

icon clock
10 |1500

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

@Christiaan Meihsl Hi, i tried the way you suggested it worked but i am wondering how can i use this API call GetAllInstrumentsListItems. When i hit this urr directly it results in err "message": "InstrumentListItem's must be retrieved in the context of their InstrumentList". It expects instrument list id somehow, how can i pass it, i tried to put that using @odata.context but i din't work.

Hello @xds-support,

Questions with accepted correct answers are not actively monitored by this forum's moderators.

It is better to ask a new question as a new question, and to include the link to the related question in the question's body.

Try:

GET {
                     {protocol}}{
                     {host}}{
                     {api}}Extractions/InstrumentLists('{
                     {listId}}')/ThomsonReuters.Dss.Api.Extractions.InstrumentListGetAllInstruments 

Where listId is the Id of your created list.

Thanks Zoya, As i already stated that the above solution works fine but how can i use rest endpoint in context with instrument list, mentioned in API TREE here

Show more comments
Click below to post an Idea Post Idea