question

Upvotes
Accepted
7 2 5 3

JSON request for TRKD TimeSeries call returns 400 bad request.

Here's my JSON request, headers, and endpoint, please let me know if there is an error. Thank you.


Endpoint: (POST) http://api.trkd.thomsonreuters.com/api/TimeSeries/TimeSeries.svc


Headers:

  • X-Trkd-Auth-Token : [TOKEN]
  • X-Trkd-Auth-ApplicationID : [AppId]
  • Accept : HTTP/1.1
  • Content-Type : application/soap+xml; charset=utf-8
  • Host : api.trkd.thomsonreuters.com
  • Content-Length : <calculated when request is sent>

Request:

{

"GetInterdayTimeSeries_Request_5": {

"Field": [

"TIMESTAMP",

"OPEN",

"HIGH",

"LOW",

"CLOSE",

"CLOSEYIELD",

"VOLUME",

"BID",

"ASK",

"VWAP"

],

"MetaField": [

"NAME",

"QOS",

"CCY",

"TZ",

"TZOFFSET",

"NAME_LL"

],

"TrimResponse": true,

"UseNonAdjusted": true,

"NotSkipInvalidRows": true,

"Symbol": "MSFT.O",

"StartTime": "2020-07-15T10:00:00",

"EndTime": "2020-07-15T23:59:00",

"Interval": "MINUTE"

}

}


Response:

Blank, with 400 Bad Request

rkd-apirkd
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
22k 58 14 21

I used this request message:

{
  "GetIntradayTimeSeries_Request_5": {
    "Symbol": "TRI.N",
    "StartTime": "2020-07-09T00:00:00",
    "EndTime": "2020-07-16T23:59:00",
    "Interval": "HOUR",
    "TrimResponse": 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
22k 58 14 21

Hi @ovx-wxu, That endpoind is for SOAP. For REST-JSON request, you need - http://api.trkd.thomsonreuters.com/api/TimeSeries/TimeSeries.svc/REST/TimeSeries_1/GetIntradayTimeSeries_5


Also, I pasted the Intraday URL, since it seems like you are requesting data for one day only.


{
  'GetIntradayTimeSeries_Response_5': {
    'R': [{
        'C': 68.35,
        'T': '2020-07-09T14:00:00+00:00'
      }, {
        'C': 67.17,
        'T': '2020-07-09T15:00:00+00:00'
      }, {
        'C': 67.13,
        'T': '2020-07-09T16:00:00+00:00'
      }, {
        'C': 67.3,
        'T': '2020-07-09T17:00:00+00:00'
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
7 2 5 3

Hello @Gurpreet. , thanks for the reply, I changed the endpoint, and now I'm getting a 500 Bad Request Error. With the following reason: "There was an error while converting from POX request. Data at the root level is invalid. Line 1, position 1."


Do you mind posting your JSON request for me to compare? Thanks!

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
7 2 5 3

@Gurpreet. , I used your request and am still getting the same error, would you mind sharing the headers you are using as well? Thank you!

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.

Oh nevermind, I figured it out, I had to set the Content-Type to JSON instead of XML, it is working now. Thank you so much!

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.