On TRTH REST API, Is there a better way to find if there was an error ?

When the RIC is wrong I get a 200 status code and I have
inspect/parse the notes trying to understand if there was an error. Is there a
better way to find if there was an error ? For example, when the start date is
after the end date I get a 4xx http status code. How do I understand
that there was an error ?

Extraction Services Version 11.0.36705 (cbb5015f7377), Built
May 2 2017 18:05:54

User ID: 9012332

Extraction ID: 2000000000470676

Schedule: 0x05bb4169ad8b3016 (ID = 0x0000000000000000)

Input List (1 items): (ID = 0x05bb4169ad8b3016)
Created: 25/05/2017 15:30:11 Last Modified: 25/05/2017 15:30:11

Report Template (24 fields): _OnD_0x05bb4169ad8b3016 (ID =
0x05bb4169bf1b3016) Created: 25/05/2017 15:30:04 Last Modified: 25/05/2017
15:30:04

Schedule dispatched via message queue (0x05bb4169ad8b3016)

Schedule Time: 25/05/2017 15:30:05

Processing started at 25/05/2017 15:30:05

Processing completed successfully at 25/05/2017 15:30:11

Extraction finished at 25/05/2017 14:30:11 UTC, with
servers: x04q13

Instrument <RIC,ESM9^9> expanded to 0 RICS.

Report suppressed because there are no instruments

Best Answer

  • fred.johnson
    Answer ✓

    I see two parts to the question:
    1) How are errors handled? 2) How is “incorrect” data handled?

    An error response to a request
    indicates the entire request failed to execute. This means the input
    parameters supplied to the API were sufficiently bad that no sense could be
    made of the request. Some requests allow data to be incorrect in some
    way, but the incorrect data is not a sufficient reason to fail the whole
    request.

    At the REST level, errors are
    reported via HTTP status codes. A message is part of the response as
    well. The client SDK translates the HTTP status codes into
    exceptions.

    See: https://hosted.datascopeapi.reuters.com/RestApi.Help/Home/StatusCodes

    image

    Incorrect data such as an
    unknown RIC supplied as input to an on-demand extraction do not cause the whole
    extraction to fail. So they are not worthy of a REST API error.
    However, the incorrect data IS worthy of being noted in the
    response. The types of output vary by API endpoint used. Generally
    speaking, this means the API returns data that indicates some sort of warning
    condition.

Answers