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
For a deeper look into our DataScope Select SOAP API, look into:
Overview | Quickstart | Documentation | Downloads | Tutorials
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
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 ?
Hello @meera.gangadharan,
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.
/Extractions/InstrumentLists({id})/ThomsonReuters.Dss.Api.Extractions.InstrumentListReplaceAllWithIdentifiers
Hope this helps
Hi @zoya.farberov,
Thank you for the detailed explanation.
Have one doubt regarding the point
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?
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 ?