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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

meera.gangadharan avatar image
1 0 0 0

Requires the API to delete an InstrumentListItem from an InstrumentList

We need the code snippet to delete an instrumentlistitem from an instrument list in the Refinitiv DataScope Select. We would also like to know how can we get the key value for a specific instrumentlistitem in an instrument list

dss-rest-apidatascope-selectdssrics
1 comment
10 |1500

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

We have tried the API /Extractions/InstrumentListItems({id}) , but this expects the id to be passed. The only other API that returns this ID is getAll : https://hosted.datascopeapi.reuters.com/RestApi.Help/Context/Operation?ctx=Extractions&ent=InstrumentListItem&opn=GetAll

At the moment the only option seems to be to iterate over this entire list and guess it based on the instrumentkey. The ‘AppendIdentifiers’ API call also doesn’t return the ID of the newly inserted row. Is there a better way of going about this ?

zoya faberov avatar image
28.3k 30 11 15

Hello @meera.gangadharan,

  • The way to obtain the DSS id = InstrumentKey is via
GET /Extractions/InstrumentLists({id})/ThomsonReuters.Dss.Api.Extractions.InstrumentListGetAllInstruments 

call, you are correct. With this approach, you will need to loop over and identify the set of InstrumentKeys that will be deleted. You have to identify InstrumentKey(s) in order to run DeletItemsById, as InstrumentKey is the only Id allowed for this operation.

  • Or you can potentially recreate the list, replace all instruments:
/Extractions/InstrumentLists({id})/ThomsonReuters.Dss.Api.Extractions.InstrumentListReplaceAllWithIdentifiers 
  • Also depending on your use case, you may prefer to delete and re-create the list itself.

Hope this helps


2 comments
10 |1500

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

Hi @zoya.farberov,

Thank you for the detailed explanation.

Have one doubt regarding the point

  • Depending on your use case, you can preserve the map of InstrumentKeys to your IDs (RICs?), when you append the instruments to the InstrumentList. Then you will have the InstrumentKeys "at hand" when you need to delete them from InstrumentList.

Actually when we are appending the instrumentlistitem to an instrumentlist we are not getting the ids in the result set, so how is it possible to preserve this map of InstrumentKeys to your IDs (RICs?)

Our Use Case - Actually in our case we are trying to add an instrumentlist item to instrumentlist and if some exception occurs in our side we need to remove the added listitem in the same call. But since the appending instrumentlistitem api doesnt returns the listitem id, we dont know what should be passed while calling deletion api.

Regards,

Meera

Hello @meera.gangadharan,

You are correct. I have not looked closely, and the keys returned by Append are only for the duplicates, not for the valid appends.

You will need to run GetAllInstruments request to determine the keys.

I will update my response.

---

For your use case, consider call GetAllInstruments once you have completed all appends, and perhaps on error case as well, and retrieve all the instruments that were added successfully. This should allow to know if there are any instruments that you wish to delete at that time. if it was not added successfully, you do not need to delete?

meera.gangadharan avatar image
1 0 0 0

Hi @zoya.farberov,

Thank you for the response.

Is there any way to get the this "id" which we need to pass for deletion? We got ids for all the instrumentlistitem in an instrumentlist through getall API. But then we need to loop over the resultset to get the required id. So we would like to know is there any other way to get this id corresponding to a specific instrumentlistitem in an instrumentlist ?

10 |1500

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