Detect securities unknown to Reuters
When requesting data for a security through its ISIN over the DSS REST API, I find out very late that actually that security is "not in the dictionary". This happens only through a bad error that I trap when trying to get the row.DynamicProperties.Item(<field name>). It suddenly tells me that the row object is not defined anymore !
But the real reason can be found by using the exception's InnerException.GetBaseException.Message, which says: "The given key was not present in the dictionary."
Isn't there a "faster" way for me to find out about that, right after getting the result of my request ? A kind of status of the request's result ?
Best Answer
-
@bernard.thouin, this is why I like Postman, it delivers the result of a call without any treatment, ideal for an investigation. Running a Ratings Extraction request for ISIN GB00BDXG0P01 delivers the following response body, which explains the issue:
{
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
"Contents": [
{
"IdentifierType": "Isin",
"Identifier": "GB00BDXG0P01",
"Error": "Not found"
}
],
"Notes": [
"All identifiers were invalid. No extraction performed."
]
}0
Answers
-
bernard.thouin, could you please post the data request you made, with the incriminated ISIN ? That will help the community to investigate.
0 -
Hi Christiaan
Here my request:
extractionRequest = New RatingsExtractionRequest With {.IdentifierList = instrumentList, .ContentFieldNames = fieldNames,
.Condition = New RatingsCondition With {
.RatingLevel = New RatingLevel With {.IsIssue = True, .IsIssuer = False},
.DaysAgo = 7,
.ReportDateRangeType = ReportDateRangeType.Last,
.IncludeInstrumentsWithNoRatings = True,
.RatingSourcesCodes = ratingCodes}}
With:
- Identifier list for security with ISIN GB00BDXG0P01, Ident. type Isin
- Filed list starting with ISIN, then Asset ID. Actually irrelevant, as the error occurs on the first field, the ISIN
The code than triggers the error is this:
' Extract value
sValue = row.DynamicProperties.Item(extractionRequest.ContentFieldNames.Item(i))
which normally returns data, but for that ISIN, it trggers an error "row is not defined", but the catch section of the Try surrounding the whole processing of the request's result gets this:
Catch ex As Exception
ex.Message = "The given key was not present in the dictionary."
I have quite a bit of code before that, which "decodes" what's in the result rows, but I get no error until that point. The result shows me 1 row with 12 fields, which is what I requested, I can decode the row.Identifier and the row.IdentifierType, the first field name using
extractionRequest.ContentFieldNames.Item(0)
but then the whole thing bombs on the retrieval of the row.DynamicProperties of the first field.
HTH
Bernard
0 -
@bernard.thouin
It seems that the ISIN GB00BDXG0P01 is not valid, so the result doesn't contain any data including the ISIN field. As result, the "ISIN" key is not available in the dictionary, and then cause the error when you try to access the field directly.
0 -
Ah yes, seeing your "Error" label, I discovered I could test on row.Error for the value "Not found", and therefore trap theses non-existing ISINs as the first thing to do when processing each result row. That works fine
0
Categories
- All Categories
- 6 AHS
- 39 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 中文论坛