Facility-Code icon indicating copy to clipboard operation
Facility-Code copied to clipboard

Ability to filter searches by the date/time last changed

Open RowlandShaw opened this issue 2 years ago • 2 comments

For some use cases, where the data is going to be interchanged frequently, it may be beneficial for the client to cache the results from the API.

Currently there is no mechanism to support incremental updates, so I'd suggest something like an optional parameter on the query string to support only returning search results that have been updated since that date.

For example, you could call endpoints: /facilities/byCountry/GB/BIC?updateFromUtc=2018-03-06T10:39:00 to get all changes to facilities in the UK changed since 10:39 on the 6th March 2018 (UTC), or: /facilities/byLocation/GBCLL/BIC?updateFromUtc=2022-03-01T00:00:00 to get all changes to facilities in Coleshill, UK changed this year - which might pick up the change in ownership of the Hams Hall Rail Terminal which recently changed ownership from ABP to Maritime Transport

If the codeProvider could be defaulted, or moved to the query string, this could even allow for calls like /facilities/?updateFromUtc=2022-03-01T00:00:00 which could be useful for shipping lines to keep their master data in line, rather than having to periodically query all the records for the territories they're active in.

Granted this would mean that the last modified date would need to be exposed from the underlying data, for future calls to be useful

An alternative proposal, could be for interested parties to register call back URLs as subscriptions (similar to how DCSA have defined for their track and trace API) - this could then get updates reflected in near real time.

RowlandShaw avatar Jul 08 '22 13:07 RowlandShaw