Intraday Summaries extraction on TRTHv2 using Python language resulting '{"error":{"message":"Malfor

error-msg-1.pngtrth-ondemand-intradaybars.txtOne of our clients trying to extract Intraday Summaries data from TRTHv2 using Python language but receiving '{"error":{"message":"Malformed request payload: \'@odata.type\' is either missing or misplaced for type ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionRequest"}}'

Best Answer

  • @Beera.Rajesh, the code is that from one of our samples. Content field names, identifier and time range were changed. The code runs fine for me as well.

    This error occurs when the order of the elements of a JSON request is not preserved. This is because the API expects to receive the @odata.type as first item; if that is not the case, then you get this specific error.

    I'm guessing your customer is importing an old version of the requests library, which does not respect the order. I'm using requests version 2.12.4, it works fine.

Answers