How to append historical instruments to an instrument list through the REST API?

rodrigogaf
rodrigogaf Newcomer

From the Tick History User Guide, to add an Instrument to a list we provide this body:
{
"Identifiers": [
{
"@odata.type": "#ThomsonReuters.Dss.Api.Search.HistoricalSearchResult",

"Identifier": "IBM.N",

"IdentifierType": "Ric"
}
],

"KeepDuplicates": true
}

Is there any body key value for allowing historical instruments? (Like we have on OnDemmand requests: "ValidationOptions": {
"AllowHistoricalInstruments": true
}) Where can I find all key values for this add instrument request body?

Best Answer

  • Christiaan Meihsl
    Answer ✓

    @rodrigogaf,

    To be able to append a historical instrument, you need to change the user preferences, to enable "Allow Import of Historical Instruments". This can be done in the user preferences GUI:

    image

    Once that is done your append command via the API will work fine.

Answers

  • zoya faberov
    zoya faberov ✭✭✭✭✭

    Hello @rodrigogaf,

    Depending on what request you are looking to use.

    Are you looking to run HistoricalSearch request

    {{protocol}}{{host}}{{api}}Search/HistoricalSearch

    ?

    Then there can only be one instrument passed, but the result will return the found instruments within date range in history, without specifying additional validation options such as AllowHistoricalInstruments = true

    {
    "Request": {
    "Identifier": "US4592001014",
    "IdentifierType": "Isin",
    "Range": {
    "Start": "2008-01-01T00:00:00.000Z",
    "End": "2008-01-01T00:00:00.000Z"
    }
    }
    }

    Are you looking to run Historical Reference Extraction

    {{protocol}}{{host}}{{api}}Extractions/Extract

    ?

    {
    "ExtractionRequest": {
    "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.HistoricalReferenceExtractionRequest",
    "ContentFieldNames": [
    "RIC", "CUSIP", "ISIN", "SEDOL", "Issuer OrgID", "Exchange Code", "Currency Code", "Change Date"
    ],
    "IdentifierList": {
    "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
    "InstrumentIdentifiers": [
    {
    "Identifier": "00209tab1",
    "IdentifierType": "Cusip"
    },
    {
    "Identifier": "IBM.N",
    "IdentifierType": "Ric"
    },
    {
    "Identifier": "US4592001014",
    "IdentifierType": "Isin"
    },
    {
    "Identifier": "B1YW440",
    "IdentifierType": "Sedol"
    }
    ],
    "ValidationOptions": {"AllowHistoricalInstruments": true},
    "UseUserPreferencesForValidationOptions": false
    },
    "Condition": {
    "StartDate": "2017-05-01T00:00:00.000Z",
    "EndDate": "2017-05-31T23:59:59.000Z"
    }
    }
    }

    Then you will pass the ValidationOptions like above.

    I hope this helps, otherwise, please indicate what request you are asking about.

  • Not solved yet. This is my request:

    POST https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/InstrumentLists('MY_INSTRUMENT_LIST_ID')/ThomsonReuters.Dss.Api.Extractions.InstrumentListAppendIdentifiers
    Authorization: Token
    Content-Type: application/json
    Accept-Charset: UTF-8
    Prefer: respond-async
    {
    "Identifiers": [
    {
    "@odata.type": "#ThomsonReuters.Dss.Api.Search.HistoricalSearchResult",
    "Identifier": "DOLF18",
    "IdentifierType": "Ric"
    }
    ],
    "KeepDuplicates": true
    }

    As I see, with this request I want the expired future contract with Ric 'DOLF18' in the instrument list associated with the ID: 'MY_INSTRUMENT_LIST_ID'. When I run this request I get 'Ric not found'.

    However, the Ric exists and can be found with a Historical Search in DataScope where I can add it manually to my instrument list, but I want to add through the REST API.

    So, my question is: How can I and add historical instruments to my instruments list trough the REST API using the end point bellow?

    https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/InstrumentLists('MY_INSTRUMENT_LIST_ID')/ThomsonReuters.Dss.Api.Extractions.InstrumentListAppendIdentifiers

    Is there any parameters that I should add in my request body?
    Thank you!

  • Thank you @Christiaan Meihsl! It works now.