question

Upvotes
Accepted
16 4 3 14

I am getting this error: HTTP/1.1 400 Bad Request . Attached my complete query.

400-bad-request.png

tick-history-rest-api
400-bad-request.png (220.6 KiB)
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
13.7k 26 8 12

@Manigandan.R

For your 2nd request:

{"ExtractionRequest":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.CorporateActionsStandardExtractionRequest","ContentFieldNames":["Corporate Actions Type","Currency Code","Fitch Issuer ID","Instrument ID","Instrument ID Type","ISIN","Issue Level Event ID","MIC","Moodys Issuer ID","OPOL","PILC","RIC","S&P Issuer ID","Security Description","Security Long Description","SEDOL","Shares Amount","Shares Amount Date","Shares Amount In Thousands","Shares Amount Type","Shares Amount Type Default Flag","Shares Amount Type Description"],"IdentifierList":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList","InstrumentIdentifiers":[{"Identifier":"6758.T","identifierType":"RIC"}],"ValidationOptions":null,"UseUserPreferencesForValidationOptions":false},"Condition":{"ReportDateRangeType":"Range","QueryStartDate":"2017-05-10T16:54:22.827+08:00","QueryEndDate":"2017-05-12T16:54:22.827+08:00","IncludeInstrumentsWithNoEvents":true,"IncludeNullDates":false,"ExcludeDeletedEvents":true,"IncludeCapitalChangeEvents":true,"IncludeDividendEvents":true,"IncludeEarningsEvents":true,"IncludeMergersAndAcquisitionsEvents":true,"IncludeNominalValueEvents":true,"IncludePublicEquityOfferingsEvents":true,"IncludeSharesOutstandingEvents":true,"IncludeVotingRightsEvents":true,"CorporateActionsDividendsType":"DividendPayDate","CorporateActionsEarningsType":"PeriodEndDate","CorporateActionsStandardEventsType":"SHO","ShareAmountChoice":"All","ShareAmountTypes":[]}}}

If I run it inside Postman (a great tool for debugging) I get this error message:

"Malformed request payload: For the property name \"identifierType\" in the JSON request the value could not be parsed successfully. Please check the casing or spelling of the property."

That clearly points to an issue with field identifierType. It should be IdentifierType (with a capital I).

After correction and re-run I get another error message:

"Malformed request payload: Error while parsing an enum value: Requested value 'RIC' was not found."

That one comes from the IdentifierType, which should be Ric, not RIC.

After correcting that 2nd error, the request runs fine.

You can use Postman in the same way to quickly debug API calls.

For your 3rd request:

{"ExtractionRequest":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.TickHistoryTimeAndSalesExtractionRequest","ContentFieldNames":["Trade - Price","Trade - Volume","Trade - Exchange Time"],"IdentifierList":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList","InstrumentIdentifiers":[{"Identifier":"6758.T","identifierType":"RIC"}],"ValidationOptions":null,"UseUserPreferencesForValidationOptions":false},"Condition":{"MessageTimeStampIn":"GmtUtc","ApplyCorrectionsAndCancellations":true,"ReportDateRangeType":"Range","QueryStartDate":"2017-05-10T16:55:13.288+08:00","QueryEndDate":"2017-05-12T16:55:13.288+08:00","DisplaySourceRIC":true}}}

It has exactly the same 2 errors.

For your 1st request:

{"Request":{"IdentifierList":"{\"@odata.type\":\"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList\",\"InstrumentIdentifiers\":[{\"Identifier\":\"XS062249170\",\"identifierType\":\"ISIN\"}],\"Range\":\"{\\\"Start\\\":\\\"2017-05-08T00:00:00.000Z\\\",\\\"End\\\":\\\"2017-05-11T00:00:00.000Z\\\"}\"}"}}

I'm still trying to guess what this one is for (hence my request for the method and endpoint URL). That said, I see the same error on the syntax of IdentifierType, and you should replace ISIN with Isin. That should help.

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
16 4 3 14

400-bad-request.txt @Christiaan Meihsl


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.

@Manigandan.R

Could you please also tell us what method you are using (GET, POST) and what endpoint URL you are using, for each of these 3 requests ? It is difficult for us to guess what you are tying to achieve, especially for the first one.

I guessed the 2nd and 3rd, and found 2 errors in the 1st query, but could not test the 1st because I don't know what endpoint you are using. If my answer below does not suffice, please communicate the endpoint you are using.

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.