For a deeper look into our DataScope Select SOAP API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
3 1 0 0

DSS REST API extraction automatically flips the last character of my CUSIP code

I am trying to extract an instrument via REST API using the following request body:

{
    "ExtractionRequest": {
        "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.CompositeExtractionRequest",
        "ContentFieldNames": [
            "Instrument ID Type",
            "Instrument ID",
            "CUSIP",
            "CIN Code",
            "SEDOL",
            "OCC Code",
            "ISIN",
            "Ticker",
            "RIC",
            "Security Description",
            "Currency Code Scaled",
            "Country of Issuance",
            "Domicile",
            "Asset Type",
            "Asset Type Description",
            "Asset SubType",
            "Asset SubType Description",
            "Organizational SubType Code",
            "Organizational SubType Description",
            "Refinitiv Classification Scheme",
            "Refinitiv Classification Scheme Description",
            "Structured Security Flag",
            "Market Capitalization",
            "Issue Date",
            "Maturity Date",
            "Coupon Rate",
            "Next Pay Date",
            "Coupon Frequency",
            "Coupon Frequency Description",
            "Callable Flag",
            "Next Call Date",
            "Next Call Price",
            "Accrual Date",
            "Annualized Dividend Adjusted Gross Amount",
            "Day Count Code Description",
            "Underlying CUSIP",
            "Dividend 1 Ex Date",
            "Dividend 1 Record Date",
            "Exchange Description",
            "Exchange Code",
            "Put Call Flag",
            "Dividend Yield",
            "Trading Status"
        ],
        "IdentifierList": {
            "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
            "InstrumentIdentifiers": [
                {
                    "Identifier": "99QAUBI8I",
                    "IdentifierType": "Cusip"
                }
            ],
            "ValidationOptions": null,
            "UseUserPreferencesForValidationOptions": true
        }
    }
}

However the response shows me a different CUSIP code:

{
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
    "Contents": [
        {
            "IdentifierType": "Cusip",
            "Identifier": "99QAUBI89",
            "Error": "Not found"
        }
    ],
    "Notes": [
        "All identifiers were invalid.  No extraction performed."
    ]
}

The last character in my original CUSIP is "I" but the CUSIP in the response is "9". Any idea why this happens? Thanks!

dss-rest-apidatascope-selectdss
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
38.1k 69 35 53

@cabissi

It may relate to settings in the DSS User Preferences.

If I check only Allow Import of Unsupported Instruments into Instrument Lists,it returns:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
    "Contents": [
        {
            "IdentifierType": "Cusip",
            "Identifier": "99QAUBI89",
            "Error": "Not found"
        }
    ],
    "Notes": [
        "All identifiers were invalid.  No extraction performed."
    ]
}

If I check both Allow Import of Unsupported Instruments into Instrument Lists and Allow Import of Historical Instruments,it returns:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
    "Contents": [
        {
            "IdentifierType": "Cusip",
            "Identifier": "99QAUBI8I",
            "Error": "Not found"
        }
    ],
    "Notes": [
        "All identifiers were invalid.  No extraction performed."
    ]
}

Please verify your User Preferences in DSS.


1611886240500.png (146.7 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

Hello @cabissi,

Does not sound right.

Just tried running the same request, the result for me was:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
    "Contents": [
        {
            "IdentifierType": "Cusip",
            "Identifier": "99QAUBI8I",
            "Error": "Not found"
        }
    ],
    "Notes": [
        "All identifiers were invalid.  No extraction performed."
    ]
}

Could you please re-run the request on your side (would it make sense to submit the "naked" request with Postman, to avoid any inadvertent modification in code, subsequent to the request definition), to try to confirm if this result is consistent?

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
3 1 0 0

Hello,

Just tried again but still getting the same output with the last character of Cusip identifier changed to "9".

I also made up a C# function to test this out, just so taking Postman out of the picture.

public static async Task<bool> ExtractInstrumentData()
        {
            string token = await GetToken();

            try
            {
                // Create list of instrument identifiers
                var instrumentIdentifiers = new List<InstrumentIdentifier>
                {
                    new InstrumentIdentifier { Identifier = "99QAUBI8I", IdentifierType = "Cusip" }
                };

                // Extract instrument data
                var start = DateTime.Now;
                using (var request = new HttpRequestMessage(HttpMethod.Post, baseURL + "Extractions/ExtractWithNotes"))
                {
                    // Identifier list
                    var identifierList = new JObject
                    {
                        {"@odata.type", "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList" },
                        {"InstrumentIdentifiers", JArray.FromObject(instrumentIdentifiers) },
                        {"UseUserPreferencesForValidationOptions", "true"}
                    };

                    // Content fields
                    var fields = new List<string>
                    {
                        "Instrument ID Type",
                        "Instrument ID",
                        "CUSIP",
                        "CIN Code",
                        "SEDOL",
                        "OCC Code",
                        "ISIN",
                        "Ticker",
                        "RIC",
                        "Security Description",
                        "Trading Status"
                    };

                    // Extraction request
                    var extractionRequest = new JObject
                    {
                        {"@odata.type", "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.CompositeExtractionRequest" },
                        {"ContentFieldNames", JArray.FromObject(fields) },
                        {"IdentifierList", identifierList }
                    };

                    var requestBody = new JObject
                    {
                        {"ExtractionRequest", extractionRequest}
                    };

                    request.Content = new StringContent(JsonConvert.SerializeObject(requestBody), Encoding.UTF8, "application/json");

                    using (var client = new HttpClient(new HttpClientHandler() { UseCookies = false }))
                    {
                        client.Timeout = new TimeSpan(0, 10, 0);
                        client.DefaultRequestHeaders.Add("Authorization", "Token" + token);

                        using (var response = await client.SendAsync(request))
                        {
                            if (response.IsSuccessStatusCode)
                            {
                                Console.WriteLine($"Time spent on extraction: {(DateTime.Now - start).TotalMilliseconds} Milliseconds");
                                File.WriteAllText(@"C:\Temp\output\extraction_result.json", JObject.Parse(response.Content.ReadAsStringAsync().Result).ToString());
                            }
                            else
                            {
                                Console.WriteLine($"Error loading Refinitiv instrument: {response.Content.ReadAsStringAsync().Result}");
                                return false;
                            }
                        }
                    }
                }

                return true;
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error loading Refinitiv instrument: {ex.Message}");
                return false;
            }
        }

However the output is still the same:

{
  "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.ExtractionResult",
  "Contents": [
    {
      "IdentifierType": "Cusip",
      "Identifier": "99QAUBI89",
      "Error": "Not found"
    }
  ],
  "Notes": [
    "All identifiers were invalid.  No extraction performed."
  ]
}
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

Hello @cabissi,

I am able to reproduce the issue using .Net RESTAPIExample application.

The modification does not happen when a raw request is submitted, such as Postman, it's being introduced by .Net SDK tier.

I have opened investigation case #09575187 on your behalf, you should hear back, from Tick History support, via email, shortly.

In the meantime, as a workaround, in my understanding, you have the option to submit the request as RIC identifier via .Net SDK, or submit it as CUSIP, without the use of .Net SDK.

I hope this helps

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
3 1 0 0

Thanks for the update. However the modification does happen to me within Postman. Could you please clarify how I submit the "naked" request with Postman as you suggested above? Thanks!

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
23k 22 9 14

Hello @cabissi,

Is the question still relevant?

Thanks to my colleague @jirapongse.phuriphanvichai, we have a good idea what is happening here.

In addition to verifying DSS preferences per id, as described above, please also make sure, in DSS example app request c# code, to modify the request to absorb user preferences, for example (seen in bold):

 var extractionRequest = new CompositeExtractionRequest
            {                     
            IdentifierList = InstrumentIdentifierList.Create(
                    new[] { new InstrumentIdentifier /* { Identifier = "IBM.N", IdentifierType = IdentifierType.Ric } */            
            { Identifier = "99QAUBI8I", IdentifierType = IdentifierType.Cusip } }, null, true ), //false),
                ContentFieldNames = new[] {
                    "Daily Beta - 180 Days", "Volatility - 30 days", "Market Capitalization", "Average Volume - 30 Days",
                    "Volume", "Total Shares - Listed"}
            };

In my test, if the preferences are correct, and are absorbed by ,Net request, then .Net request results in the same expected RIC result as Postman request.



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea