question

Upvotes
Accepted
1 1 1 2

TickHistoryRawExtractionRequest API query in python

I am trying to run the following API query in python but get the error -

"error":{"message":"Validation Error:\r\n\r\nCannot run a normal extraction for a \"Tick History Raw\" template type.  You must use ExtractRaw instead."}


Can anyone help clarify where I am going wrong? I am able to run a query using - #ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.HistoricalReferenceExtractionRequest, so not sure why TickHistoryRawExtractionRequest doesnt work?


payload = {

"ExtractionRequest": {

"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryRawExtractionRequest",

"ContentFieldNames": [

"RIC",

"CUSIP",

"ISIN",

"SEDOL",

"Change Date"

],

"IdentifierList": {

"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",

"InstrumentIdentifiers": [

{ "Identifier": "IBM.N", "IdentifierType": "Ric" }

]

},

"Condition": {

"MessageTimeStampIn": "GmtUtc",

"ReportDateRangeType": "Range",

"QueryStartDate": "2019-10-07T12:00:00.000Z",

"QueryEndDate": "2019-10-09T12:10:00.000Z",

"ExtractBy": "Ric",

"SortBy": "SingleByRic",

"DomainCode": "MarketPrice",

"Fids": "25,22",

"DisplaySourceRIC": True

}

}

}


tick-history-rest-api
icon clock
10 |1500

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

@Aby

Thank you for your participation in the forum. Are any of the replies below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply that best answers your question. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS

Upvotes
Accepted
13.7k 26 8 12

@Aby,

for a Tick History Raw extraction request you need to use the ExtractRaw endpoint. I am guessing you are using the Extract endpoint, which is not supported.

Please refer to the REST API tutorial 8 for more details on this particular extraction.

icon clock
10 |1500

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

Upvotes
1 1 1 2

Thanks @. When I run the query now I get the following response. Can you tell me where I am going wrong?

{"@odata.context":"https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#RawExtractionResults/$entity","JobId":"0x06d468e36341096c","Notes":["All identifiers were invalid.  No extraction performed."],"IdentifierValidationErrors":[{"Identifier":{"@odata.type":"#ThomsonReuters.Dss.Api.Content.InstrumentIdentifier","Identifier":"IBM.NOI","IdentifierType":"Ric","Source":""},"Message":"Not found"}]}

This is the query I am running.

{

"ExtractionRequest": {

"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryRawExtractionRequest",

"IdentifierList": {

"@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",

"InstrumentIdentifiers": [

{ "Identifier": "IBM.NOI", "IdentifierType": "Ric" }

]

},

"Condition": {

"MessageTimeStampIn": "GmtUtc",

"ReportDateRangeType": "Range",

"QueryStartDate": "2019-10-07T00:00:00.000Z",

"QueryEndDate": "2019-10-09T00:00:00.000Z",

"ExtractBy": "Ric",

"SortBy": "SingleByRic",

"DomainCode": "MarketPrice",

"Fids": "4338",

"DisplaySourceRIC": True

}

}

}

icon clock
10 |1500

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

Upvotes
22.1k 59 14 21

Hello @Aby, The item requested: IBM.NOI is not a valid RIC. I can successfully send your request message with IBM.N and get data:

#RIC,Domain,Date-Time,GMT Offset,Type,MsgClass/FID number,UpdateType/Action,FID Name,FID Value,FID Enum String,PE Code,Template Number,Key/Msg Sequence Number,Alias Underlying RIC,Number of FIDsIBM.N,Market Price,2019-10-07T11:00:00.810009456Z,-4,Raw,UPDATE,CLOSING_RUN,,,,62,,14558,,1,,,,FID,4338,,IMB_SH,,
icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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