DSS Rest Api with big list of identifiers

Hi,

I try to make an Extraction request for Corporate Actions based on a big list of intruments (around 180 FileCode).

The request work fine with 1 File code but I get an empty result with the full list after few seconds.

Do you have a timeout on you side?

I'm using Java to make the request, but same results using an RESTClient plugin in Firefox.

Best Answer

Answers

  • @Stephane Rossi

    Can you share the exact request you are making ?

    There is a working example here that might also help you.

  • Here the request:

    @{"ExtractionRequest":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.CorporateActionsStandardExtractionRequest","ContentFieldNames":["Actual Adjustment Type Description","Deal Cancel Date","Shares Amount Date","Company Role Description","Delete Marker","Country of Incorporation","RIC","Company RIC","Security Description","Company Name","Capital Change Ex Date","Deal Effective Date","Country","Last Update Timestamp","Corporate Actions Type","Deal Announcement Date","Capital Change Announcement Date","File Code","Thomson Reuters Classification Scheme Description"],"IdentifierList":{"@odata.type":"#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList","InstrumentIdentifiers":[{"Identifier":"787","IdentifierType":"FileCode"},{"Identifier":"211","IdentifierType":"FileCode"},{"Identifier":"911","IdentifierType":"FileCode"},{"Identifier":"160","IdentifierType":"FileCode"},{"Identifier":"378","IdentifierType":"FileCode"},{"Identifier":"405","IdentifierType":"FileCode"},{"Identifier":"9","IdentifierType":"FileCode"},{"Identifier":"712","IdentifierType":"FileCode"},{"Identifier":"592","IdentifierType":"FileCode"},{"Identifier":"556","IdentifierType":"FileCode"}]},"Condition":{"ReportDateRangeType":"Range","PreviousDays":0,"QueryEndDate":"0001-01-01T00:00:00.000Z","ExcludeDeletedEvents":false,"IncludeInstrumentsWithNoEvents":false,"IncludeCapitalChangeEvents":true,"CorporateActionsCapitalChangeType":"CapitalChangeAnnouncementDate","IncludeSharesOutstandingEvents":true,"CorporateActionsSharesType":"SharesAmountDate","ShareAmountTypes":["Authorised","CloselyHeld","FreeFloat","Issued","Listed","Outstanding","Treasure","Unclassified"],"IncludeMergersAndAcquisitionsEvents":true,"CorporateActionsMergersAcquisitionsType":"DealAnnouncementDate","IncludePublicEquityOfferingsEvents":true,"CorporateActionsEquityOfferingsType":"FirstTradingDate"}}}

    (I remove some identifier, this request work fine with only 1)
  • I see in RestClient plugin in FF a status code 202 with Status "InProgress".

    Then more like an asyncr call. Then how handle the reply? I don't see any example for Java

  • Status code 202 means the call was Accepted, i.e. the request is correct, but timed out because there is too much data. That is why the body of the response is empty.

    How to handle this:

    In the response header you will find a Location URL, it looks something like:

    Location https://hosted.datascopeapi.reuters.com/RestApi/v1/monitor/'0x056a114ea0fb2f96'

    You can retrieve the data, once it is ready, by using a GET request on that URL:

    • If you run this GET request and the data is not yet ready, then you will get a similar response.
    • If you run this GET request and the data is ready, then you will get the data.
    • If you run this GET request again (after having received the data), then you will get a 404 (data not found).

    The more data is requested, the longer it can take for it to be available.

  • I juste found an example of long request in

    DSS2IntraDayClient.java, I try to use it.

    Thanks

    Stephane

  • Working fine ! Only a small bug in the example, the poll URL is in the header[4] and not in the header[3]. But I can check the key inside the header to found the correct value in the array.

  • Here an way to get it:

    Header[] headers = response.getAllHeaders();

    String pollURL = null;

    for (Header entry: headers) {

    if (entry.getName().equals("Location")) {

    pollURL = entry.getValue();

    }

    }

  • Would it be possible to convert the examples to use the key rather than the index? The order of the headers is not guaranteed. Thank you @susana.chang.

  • @Christiaan Meihsl, Troy,

    I checked the TimeSeries example (we search by the 'Location' key in the header), and this is what is in the code currently:

    for (int i= 0; i< headers.length; i++) {
    if (headers[i].getName().equalsIgnoreCase("Location")) {
    pollURL = headers[i].getValue();
    System.out.println("The Poll URL : " + pollURL);
    }
    }

    The older version of the example may have the hard coded index number.

  • @Stephane Rossi

    For your information, the Java examples available under the downloads tab have been modified to optimize handling of the poll URL.