Pagination using the http json api service

Hey guys,

As the title suggests, I’m trying to look in to pagination whilst using the json api service. In particular, I’m looking at the best ways to present contracts of a certain template to a UI. Of course I do not want to receive all X thousand instances of a template for every user request to view a certain page, preferably I would want the first Y contracts, sorted by a defined data field.

I can’t see anything in the docs for this sort of request, is such functionality available, or should this type of action be handled in a different manner?

Thanks in advance!

1 Like

Hi @lashenhurst, at the moment there is no support for pagination in the JSON API. There is an open issue for this if you want to track it Support for paginated queries in JSON API · Issue #6595 · digital-asset/daml · GitHub. In the meantime, you can either try limiting it to subsets by trimming down your queries or you can explore whether the streaming API might fit your usecase better.

1 Like

Thanks for getting back to me! That issues seems to have been open for quite a while, is there a date in mind for when this might be addressed?

We don’t have a timeline for this feature at this point.