For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
1 2 2 2

Getting malformed request payload while retrieving SinglePriceHistory

{
    "ExtractionRequest": {
        "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.SinglePriceHistoryExtractionRequest",
        "ContentFieldNames": [
            "Ask High",
            "Ask Low",
            "Bid High",
            "Bid Low",
            "Trade Date"
        ],
        "IdentifierList": {
            "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
            "InstrumentIdentifiers": [
                {
                    "Identifier": "TRI.N",
                    "IdentifierType": "Ric"
                }
            ],
            "ValidationOptions": null,
            "UseUserPreferencesForValidationOptions": false
        },
        "Condition": {
            "EndDate": "2019-08-28T09:26:04.439Z",
            "Lookback": "FourMonths",
            "AdjustedPrices": false,
            "LastEntityOnly": false
        }
    }
}


For above request I am getting 400 Error with below response


{
    "error": {
        "message": "Malformed request payload: Unexpected @odata.type 'DataScope.Select.Api.Extractions.ExtractionRequests.ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.SinglePriceHistoryExtractionRequest' in payload"
    }
}

Has the Request type changed recently or is it due to some other issue ?

What is the alternative to fetch the historical price if this is not working?

dss-rest-apidatascope-selectdss
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
Accepted
78.2k 246 52 72

@avadhesh.gadia

I assume that you are testing it with the new endpoint: selectapi.datascope.refinitiv.com. I got the same error when using the attached request with this endpoint.

{     "error": {         "message": "Malformed request payload: Unexpected @odata.type 'DataScope.Select.Api.Extractions.ExtractionRequests.ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.SinglePriceHistoryExtractionRequest' in payload"     } }

To use this endpoint, you need to change the data type (@data.type) from "ThomsonReuters.Dss.*" to "DataScope.Select.*", as shown below.

{
    "ExtractionRequest": {
        "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.SinglePriceHistoryExtractionRequest",
        "ContentFieldNames": [
            "Ask High",
            "Ask Low",
            "Bid High",
            "Bid Low",
            "Trade Date"
        ],
        "IdentifierList": {
            "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
            "InstrumentIdentifiers": [
                {
                    "Identifier": "TRI.N",
                    "IdentifierType": "Ric"
                }
            ],
            "ValidationOptions": null,
            "UseUserPreferencesForValidationOptions": false
        },
        "Condition": {
            "EndDate": "2019-08-28T09:26:04.439Z",
            "Lookback": "FourMonths",
            "AdjustedPrices": false,
            "LastEntityOnly": false
        }
    }
}
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.

Upvote
32.2k 40 11 19

Hello @avadhesh.gadia,

This is surprising. I just run the same request, via latest Postman tool. My result was:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
    "Contents": [
        {
            "IdentifierType": "Ric",
            "Identifier": "TRI.N",
            "Ask High": null,
            "Ask Low": null,
            "Bid High": null,
            "Bid Low": null,
            "Trade Date": null
        }
    ],
...

I have submitted to

{ {protocol}}{ {host}}{ {api}}Extractions/ExtractWithNotes

However, I am not sure if this result is what you are looking for. Just in case, I have tried a different request, but perhaps this would be more of the result set you would be interested to see:

{
  "ExtractionRequest": {
    "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.PriceHistoryExtractionRequest",
    "ContentFieldNames": [
      "File Code",
      "RIC",
      "Trade Date",
      "Last Trade Price",
      "Universal Close Price",
      "Alternate Close Price",
      "High Price",
      "Low Price",
      "Open Price",
      "Volume Weighted Average Price",
      "Turnover",
      "Volume",
      "Accumulated Volume Unscaled",
      "Bid Price",
      "Asset Type",
      "Quote ID",
      "Bid Yield",
      "Exchange Code",
      "Currency Code"          
    ],
    "IdentifierList": {
      "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",  
      "InstrumentIdentifiers": [
        { "Identifier": "TRI.N", "IdentifierType": "Ric" }
      ]
    },
    "Condition": {
      "AdjustedPrices": true,
      "QueryStartDate": "2018-05-24T00:00:00.000Z",
      "QueryEndDate": "2019-05-31T00:00:00.000Z"
    }
  }
}

results in:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
    "Contents": [
        {
            "IdentifierType": "Ric",
            "Identifier": "TRI.N",
            "File Code": "77",
            "RIC": "TRI.N",
            "Trade Date": "2018-05-24",
            "Last Trade Price": null,
            "Universal Close Price": 38.35,
            "Alternate Close Price": null,
            "High Price": 38.77,
            "Low Price": 38.3,
            "Open Price": 38.56,
            "Volume Weighted Average Price": 38.4466,
            "Turnover": 25412988.775,
...

For in-depth, individual help with Refinitiv content, as a customer, please submit your content questions directly to Refinitiv Helpdesk Online -> Content -> DSS



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.