question

Upvotes
Accepted
262 12 15 18

Intraday Summaries extraction on TRTHv2 using Python language resulting '{"error":{"message":"Malformed request payload: \'@odata.type\' is either missing or misplaced for type ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionRequest"}}'

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"}}'

pythontick-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.

@Beera.Rajesh, the text attachment contains the username and password. As the forum is public, this means the password was compromised. Please ask your customer to change his password ASAP.

@Christiaan Meihsl Taken care, Thank you

@Beera.Rajesh, thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text beneath the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question. Thanks, AHS

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query?

If yes please click the 'Accept' text beneath the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

@Beera.Rajesh

Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply.

This will guide all community members who have a similar question.

Thanks,

AHS

@Beera.Rajesh, 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

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

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
262 12 15 18

tested-on-my-end-successfull-without-error.png

When I test on my end, I don't see an error (attached) . Please suggest what can be the reason for client side error


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.