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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Stephane Rossi avatar image
76 3 2 11

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.

dss-rest-apidatascope-selectdssjava
10 |1500

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

pimchaya.wongrukun01 avatar image
9.5k 10 5 7

Hello @Stephane Rossi

The example to handle status code 202 can be found in DSS2TimeSeriesClient.java at timeSeriesExtractRequest() method.

For more details of handling async, please refer to https://hosted.datascopeapi.reuters.com/RestApi.Help/Home/KeyMechanisms?ctx=Extractions&stp=1&tab=0&uid=Async

10 |1500

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

Christiaan Meihsl avatar image
13.7k 26 8 12

@Stephane Rossi

Can you share the exact request you are making ?

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

10 |1500

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

Stephane Rossi avatar image
76 3 2 11

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)
10 |1500

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

Stephane Rossi avatar image
76 3 2 11

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

10 |1500

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

Christiaan Meihsl avatar image
13.7k 26 8 12

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.

10 |1500

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

Stephane Rossi avatar image
76 3 2 11

I juste found an example of long request in

DSS2IntraDayClient.java, I try to use it.

Thanks

Stephane

10 |1500

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

Stephane Rossi avatar image
76 3 2 11

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.

2 comments
10 |1500

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

@Stephane Rossi

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

@Stephane Rossi

Glad it works now. I have escalated the issue you found with the example.

Stephane Rossi avatar image
76 3 2 11

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();

}

}

1 comment
10 |1500

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

Thank you for sharing !