GET Period summary (List) - how to iterate to retrieve all records

Hi,

I am trying to get the list of ALL records for GET Period summary (list). I understand that the API return limit is 5000.

However, when I use the offset parameter, it does not return me the exhaustive list of records, it even returns me more records.

Let say that the count is 6200 records, I make a first call for the first records 1000 to 5000 and then for 5001 to 6200, but it actually returns me 10,000 records.

Is there something I am missing?

Thanks,

Pete

Comments

  • Michael Tims
    Michael Tims Blackbaud Employee
    Seventh Anniversary Kudos 2 Name Dropper Participant

    Hi @PierreAndre Vungoc - I'm not sure I'm quite following based on your example.

    • If there's only 6200 total records, how are 10000 records returned? Do you see that some of the query parameters are ignored?
    • Do you have examples of what your initial and subsequent request query strings look like?

    I believe you should be able to submit the same query string for subsequent/pagination requests, but additionally supply the offset param which is the starting point of the following requests.

    For example:

    • First request is generalledger/v1/periodsummary/summaries?fiscal_period_id=id
      • Returns 5000 records
    • Second request is generalledger/v1/periodsummary/summaries?offset=5000&fiscal_period_id=id
      • Should return the remaining 1200 records

    It sounds like this is what you are doing, but would be good to confirm.

    Thanks!

  • Hi , thanks for your answer. Yes makes total sense. There was an issue with my code. So all is good now.

    Cheers,
    Pete

Categories