question

Upvotes
Accepted
50 12 22 29

Get list of files available under an exchange for a particular date range

We are currently having functionality to get list of files under an exchange across all dates. Is there anyway to get a list of files for the same exchange but for a particular date range. For example,

Currently we can download list of files under LSE exchange across all the days.

We are looking for a solution which will gave a list of files under LSE exchange for a particular day such as 29-Aug-2017.

Please help.

tick-history-rest-api
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.

@Ayan

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

Upvotes
Accepted
13.7k 26 8 12

@Ayan, ah ok, thank you for clarifying the query.

By default a query delivers 250 results. When you request the list of available files for a specific venue, the list will contain all those available for the last 30 days, which is more than 250. So the response will contain the first 250 files (most recent date first), and at the end of the response you will see a "next link", to access the next part (the older files). The "next link" is the same as the one you used for the original request, except that it has an additional skiptoken component at the end:

"@odata.nextlink": "https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByPackageId(PackageId='0x04f21a8d28f59cb1')?$skiptoken='MjAxNy0wOC0xNFQxODo1MDozMi40NzMwMDAw'"

To circumvent this, you could change the header of that request to allow for more results:

Prefer:odata.maxpagesize=500;respond-async

That way you could get them all in one go !

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

@Ayan, my answer is based on a guess that this query is about VBD files, correct me if this assumption is incorrect.

As far as I know there is no call that restricts the list of files to a particular date and exchange.

You can restrict to a date range, but it will list all user packages you are entitled to, i.e. all exchanges, using a GET to:

StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByDateRange(SubscriptionId='0x0400dc1d24a00cb4',FromDate=2017-08-28T00:00:00.000Z,ToDate=2017-08-28T23:59:59.999Z)

You can restrict to a single package ID (i.e. an exchange), but it will list all user packages for all dates, using a GET to:

StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByPackageId(PackageId='0x04f21a8d28f59cb1')

It is fairly easy to programmatically filter the result of this second call by date.

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.

Yes, it is about VBD. Thanks for the commands. Currently we have implemented the second approach.

StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByPackageId(PackageId='0x04f21a8d28f59cb1')

What we are looking is actually more customization of the second approach by providing the date limit. Is there any way to do it?

Also one more question.

1. While we are retriving the list of files associated with an exchnage, does it pull all associated availble files details?

@Ayan, sorry, there is no API call that restricts both the exchange and the date.

To your additional query: when you retrieve the list of files by exchange you get the following file details:

PackageDeliveryId, UserPackageId, SubscriptionId, File name, File date and time, File size [Bytes], Frequency, Md5 Hash

It is illustrated in the REST API Tutorial 2.

In my view the most useful are those that relate to the file, i.e. its name, date and time, size.

Thanks for the update. I believe I have not explain my question clearly. Let me elaborate.

Actually I meant to say that while pulling the file list will I get the complete list of files for last 30 days from the latest date of data availability? For example, if I am getting the list of LSE exchange today, then will I get all the files names in the list from 30th Jul,2017 to 30th Aug,2017? Or I will have a odata link at the end of the list which I need to access to get the next set of files?

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.