Last update | Nov 2023 |
Environment | Any |
Language | Any HTTP is supported |
Compilers | None |
Prerequisites | DSS login, internet access |
Source code | Below |
In the previous tutorials we created an instrument list on the fly, directly in our client application.
Instrument lists can also be created and stored on the DSS server. This can be done manually using the GUI, or using the API (as described in the next tutorial).
This tutorial explains how to use a pre-existing instrument list, saved on the DSS server, instead of creating one on the fly.
To use a pre-existing instrument list we need to know its indentifier.
As a recap of the previous tutorials, here is how we defined an instrument list on the fly in our client application:
Body:
{
"ExtractionRequest": {
...
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [
{ "Identifier": "438516AC0", "IdentifierType": "Cusip" },
{ "Identifier": "IBM.N", "IdentifierType": "Ric" }
]
}
...
}
}
Note the data type which is InstrumentIdentifierList and contains InstrumentIdentifiers.
An instrument list can also be stored on the DSS server. It can either be created using the API (the next tutorial explains how to do this), or manually in the DSS web GUI.
If it was created uisng the API, the instrument list identifier was returned in the response.
If it was created manually, and you know the instrument list name, it is possible to query the API to retrieve the instrument list identifier:
URL:
The instrument list name ('MyInstrumentList') is passed as a parameter inside the URL:
https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/InstrumentListGetByName(ListName='MyInstrumentList')
Method: GET
Headers:
Prefer: respond-async
Authorization: Token F0ABE9A3FFF2E02E10AE2765ED872C59B8CC3B40EBB61B30E295E71DE31C254B8648DB9434C2DF9299FDC668AA123501F322D99D45C8B93438063C912BC936C7B87062B0CF812138863F5D836A7B31A32DCA67EF07B3B50B2FC4978DF6F76784FDF35FCB523A8430DA93613BC5730CDC310D4D241718F9FC3F2E55465A24957CC287BDEC79046B31AD642606275AEAD76318CB221BD843348E1483670DA13968D8A242AAFCF9E13E23240C905AE46DED9EDCA9BB316B4C5C767B18DB2EA7ADD100817ADF059D01394BC6375BECAF6138C25DBA57577F0061
Response body:
{
"@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#InstrumentLists/$entity",
"ListId": "0x077f534f54076163",
"Name": "MyInstrumentList",
"Count": 3,
"Created": "2021-03-30T08:45:37.140Z",
"Modified": "2021-03-30T08:46:41.020Z"
}
The ID can also be found in the DSS web GUI. When displaying the Instrument Lists, left click on the instrument list you want, and look at the URL in the browser header. The identifier is the last part of the URL, after the # character:
This is how we refer to a pre-existing instrument list, saved on the DSS server, by referring to its ID:
Body:
Note the data type is now InstrumentListIdentifierList and contains InstrumentListId:
{
"ExtractionRequest": {
...
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentListIdentifierList",
"InstrumentListId":"0x077f534f54076163"
}
...
}
}
The other parts of the On Demand request do not change compared to what was shown in the previous tutorials.
Caution: do not modify or delete the instrument list until all extractions referencing it are complete !