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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
3 1 0 2

Extract OnDemand in C# example always end up with no data

Hi,

We are currently migrating our old SOAP API solution to the REST API. I'm trying to extract data with the C# example provided here (report template is Terms and Condition), but for some reason, it seems that the instrument provided (Ric:IBM.N) always return 0 rows in output. I tried with several instruments then, I always end up with an empty extraction. When I try to extract those same instruments with the SOAP API, I get results.

Could someone give me some explanation about this behaviour? I precise that I changed nothing in the sample, I used the same credentials as our SOAP API script.

Many thanks!

The concerned method:

        [Example("Create: Terms and Conditions")]
        public void TermsAndConditions()
        {
            Status.Notify(ExtractionsContext, "ReportTemplateType", "GetContentFieldTypes");
            //Retrieve the list of available fields.  You can skip this step if you already know the list of fields to extract.
            //The list of fields contains the code, name, format.  Either the code or name can be used as the fieldName when
            //adding content fields
            var availableFields = ExtractionsContext.GetValidContentFieldTypes(ReportTemplateTypes.TermsAndConditions);
            Status.EndNotify(ExtractionsContext);

            Status.Notify(ExtractionsContext, null, "ExtractWithNotes", MethodType.Operation, Publish.Secondary);
            //Create new report template with conditions
            var extractionRequest = new TermsAndConditionsExtractionRequest
            {
                IdentifierList = InstrumentIdentifierList.Create(
                    new[] { new InstrumentIdentifier { Identifier = "IBM.N", IdentifierType = IdentifierType.Ric } }, null, false),
                ContentFieldNames = new[] {
                    "Conversion Terms End Date", "Index Principal Flag", "Conversion Terms Start Date", "RIC", "Round Lot Size",
                    "Redemption Value", "Original Issue Amount", "Issue Price", "First Coupon Date", "Issue Date", "Par Value",
                    "Accrual Date", "Base Index", "Factor", "Original Issue Discount Flag", "End Of Month Payment Flag", "ISIN",
                    "Index Linked Bond Base Index", "Coupon Frequency Description", "Total Amount Outstanding", "Maturity Date",
                    "Total Amount Issued", "Capitilization Flag", "Currency Code", "Trading Status"},
                Condition = new TermsAndConditionsCondition
                {
                    IssuerAssetClassType = IssuerAssetClassType.AllSupportedAssets,
                    ExcludeWarrants = false,
                    DaysAgo = 3, //Use either DaysAgo or StartDate
                    //StartDate = new DateTimeOffset(new DateTime(2015, 1, 1)),
                    FixedIncomeRatingSources = FixedIncomeRatingSource.StandardAndPoors,
                }
            };

            //Extract - NOTE: If the extraction request takes more than 30 seconds the async mechansim will be used.  See Key Mechanisms 
            var extractionResult = ExtractionsContext.ExtractWithNotes(extractionRequest);
            var extractedRows = extractionResult.Contents;

            //Output
            if (!extractedRows.Any())
                Status.WriteLine("No rows returned");
            else
            {
                foreach (var row in extractedRows)
                    Status.WriteLine(
                        row.Identifier + " (" + row.IdentifierType + ") " +
                        String.Join(", ", row.DynamicProperties.Select(dp => dp.Key + "=" + dp.Value)));
                        }
            //Output Notes
            Status.WriteLine("NOTES:");
            foreach (var note in extractionResult.Notes)
                Status.WriteLine(note);
            Status.EndNotify(ExtractionsContext);
        }
dss-rest-apidatascope-selectdssc#
icon clock
10 |1500

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

Upvotes
Accepted
11.3k 25 9 14

@pascal.falbo

I have tried your code and found the same result. The extraction note also provides more information why there is no result returned.

Report Template (31 fields): _OnD_0x05b03fe60d5b2f96 (ID = 0x05b03fe60f4b2f96) Created: 04/21/2017 16:50:28 Last Modified: 04/21/2017 16:50:28
1 Instrument suppressed due to rating date not on or after 04/18/2017.
Processing completed successfully at 04/21/2017 16:50:36, taking 0.240 Secs.
Extraction finished at 04/21/2017 09:50:36 UTC, with servers: x11n01, DSHA02 (0.0 secs), QSHA02 (0.0 secs), QSHC08 (0.0 secs)
No usage to report -- 1 Instrument in the input list had no reported data.

Once I remove the code that defines the TermsAndConditionsCondition, application can retreive some data in fields. It seems like the issue is related to the content of data or the attributes of the request.

icon clock
10 |1500

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

I have also tried the Schedule extraction in GUI and found similar behavior. There will be no result, if the Delta Extraction is selected.

deltaextraction.png (28.4 KiB)

Thanks very much, for now I don't really need the conditions so your solution do the trick. I'll try to investigate further when I have some time.

Upvotes
13.7k 26 8 12

@pascal.falbo

Where did you get this sample from ? It might be an old one, I do not recognize it.

The current samples for the DSS REST API are available under the downloads tab of the DSS REST API. Among them is a working C# example for an On Demand Terms and Conditions extraction, it is explained in detail under Tutorial 8. It contains several instruments including IBM.N, and delivers data, I just retested it right now.

Later addition to this answer:

After further tests trying to understand why the current sample returns data and yours does not, I found that the presence of the conditions DaysAgo and FixedIncomeRatingSources will result in no data being returned. Without those 2 conditions, the request should return data.

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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