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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
76 8 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-apidssdatascope-selectjava
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.

Upvote
Accepted
9.6k 10 7 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

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
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.

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
76 8 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)
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
76 8 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

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.

Upvote
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.

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
76 8 2 11

I juste found an example of long request in

DSS2IntraDayClient.java, I try to use it.

Thanks

Stephane

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.

Upvote
76 8 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.

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.

@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.

Upvote
76 8 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();

}

}

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.

Thank you for sharing !

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.