SOAP API - return all records until no more records are returned

Options

I understand from the Pagination documentation about the LO SOAP API that we need to specify a page size and page number in each request. However, when trying to query for all records in a given table - say, Constituent - it's difficult to figure out what page number contains the last set of records for a page size. Is there a way to either get the API to determine the “final page number”, or to specify a negative sequence index like -1 to get the last page?

Currently, if I have a page size of 1000 and I want to know how many page numbers to iterate through, I either have to iterate through some sets of big numbers until the request returns nothing, or set the page number to an artificially high number like 5000 where I'm reasonably certain that'll return nothing (and hope that we don't have 4999 pages of records currently). We have scripts that will then iterate through each page and get the data for us, where we specify the page size to use and a start and end page number.

Tagged:

Comments

  • Hi @Katherine OHearn
    I am new to Luminate Online and would like to know if there is an API limit for Luminate Online. For example, I believe RE NXT has a limit of 25,000 API calls per day. Does Luminate Online REST API have a similar limit?
    Thanks!

  • @Katherine OHearn
    I'm not entirely familiar with Luminate Online's API, but if we take RE NXT's "Get Constituent List"

    API endpoint as an example, it includes the total record count in the first call's JSON response, like this:
    {
    "count": 123456789
    }
    You could potentially follow a similar approach with Luminate Online's API, if available. Start by making one initial API call to retrieve the total count of records. Once you have the count, you can calculate the total number of pages based on your page size and iterate accordingly.
    Thanks!

Categories