LocationEntityListing - page_count is None : Python SDK

Hello,

We are trying to fetch all locations by calling LocationsApi's get_locations method which returns LocationEntityListing.

But when we tried implementing pagination, we found that the page_count is coming None, due which we cannot iterate over all the pages.

    if response.page_number >= response.page_count:
        # If all pages fetched, done
        break

for now we are sending warning

    if response.page_count is None:
        logger.warning(f"There is no page count for {type_.value} ")
        break

Any help would be appreciated

Regards,
Amit K

Hello

It looks like the pageCount field should be there, but the API isn't returning it. Could open a case with Genesys Cloud Care to report this behaviour?

Until this is fixed, and as a suggestion, you could alter your logic to check if the entities array is empty. This will let you know that there are no more locations.

Thanks
Charlie

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.