question

Upvotes
Accepted
3 0 1 2

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

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?

tick-history-rest-apiricshistorical
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.

Upvote
Accepted
13.7k 26 8 12

@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:

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


allowhistopref.png (4.3 KiB)
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.

Upvote
23k 22 9 14

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.

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.

Upvotes
3 0 1 2

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!

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.

Upvotes
3 0 1 2

Thank you @Christiaan Meihsl! It works now.

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.

Great, glad to hear that :-)

Click below to post an Idea Post Idea