JSON request for TRKD TimeSeries call returns 400 bad request.

Options
ovx-wxu
ovx-wxu Newcomer

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

Tagged:

Best Answer

  • Gurpreet
    Gurpreet admin
    Answer ✓

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

Answers

  • 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'
  • ovx-wxu
    ovx-wxu Newcomer

    Hello @GurpreetGurpreet. , 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!

  • ovx-wxu
    ovx-wxu Newcomer

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

  • ovx-wxu
    ovx-wxu Newcomer

    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!