Is there any documentation for response headers when request is invalid?
Hello.
When we send request for data and put invalid attribute, we receive response with code 400 (Bad Reqeust). This is perfectly fine. I can see all details are stored into "X-Validation-Messages" header.
Do we have any documentation about the response headers? Can the validation message model change or can we assume we will always get the response like that?
HttpResponseProxy{HTTP/1.1 400 Bad Request [Cache-Control: no-cache, Pragma: no-cache, Content-Type: application/json; charset=utf-8, Expires: -1, Server: Microsoft-IIS/7.5, X-Validation-Messages: [{"Id":"ReportTemplate.ContentFields.ContentFieldNamesMustBeValidContentFieldTypes","ItemType":"DataScope.Select.Extractions.ReportTemplates.PriceHistoryReportTemplate","ItemId":"0x0778946ebf8751ff","PropertyName":"ContentFields","Severity":4,"Message":"Invalid content FieldName \"A\"","DiagnosticMessage":null}], X-Client-Session-Id: 2c9be13f-5793-475f-a211-1ebbebe38f7a, X-Request-Execution-Correlation-Id: CiD/150533/7T6aIA.0778946ebf7751ff/RA, X-App-Id: Custom.RestApi, X-App-Version: 14.5.56.64, Date: Tue, 09 Mar 2021 14:47:01 GMT, Content-Length: 80] ResponseEntityProxy{[Content-Type: application/json; charset=utf-8,Content-Length: 80,Chunked: false]}}
Validation model contains: Id, ItemId, PropertyName, Severity, Message, DiagnosticMessage
Another question would be related to error messages, are they somewhere documented? I mean "Invalid content FieldName" etc.
I am asking because we would like to be sure if we create a response header representation on our side, and expects some error messages it will not change in some time.
Thank you,
Michał
Best Answer
-
Hello @michal.bogdal,
One of the goals of design, when integrating with DSS REST is to pinpoint and eliminate invalid/bad requests. The bad requests take up time and execution unnecessarily. I would not recommend designing into a DSS REST application a reliance on submitting invalid requests and parsing X-Validation-Messages, would suggest to tune the requests that are required during the design stage.
There are headers that are intended to investigate a specific submission, they are documented in Datascope Hosted -> Diagnostics, you will need to be logged into Datascope GUI to access the link with this information
There are also status codes that can be received from the service, they are in Datascope Hosted -> Status Codes, at least a subset of these codes is usually processed by the app.
Also, I find Extraction Notes per Extarction ID helpful, when something unexpected is found in the result, and also for Quota tracking.
0
Answers
-
Thank you. Before we send extraction request we will first check if attributes provided by users are correct. For this purpose we will use following endpoint:
https://hosted.datascopeapi.reuters.com/RestApi/v1/Extractions/GetValidExtractionFieldNames
Cheers,
Michał
0 -
Hello @michal.bogdal,
This is usually done in design stage, to determine what fields to use going forward, please see REST API Tutorial 3: On Demand data extraction workflow "Get available field list", the tutorial says "this step is optional".
1 -
Thank you.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛