Paginating /api/v2/analytics/conversations/details/query - cursor or page?

Hey everyone. I’m trying to pull conversation detail data for the last 24 hours using the Python SDK. The goal is to get a full list of interactions to calculate some custom adherence metrics in a separate script. I know the standard way to handle large datasets is pagination, but the documentation for analytics/conversations/details/query is a bit confusing regarding the pageSize and pageNumber parameters versus the cursor-based approach mentioned in some other endpoints.

Here is the basic setup I have so far:

from genesyscloud.analytics import AnalyticsApi

analytics_api = AnalyticsApi(configuration)
body = {
 "dateFrom": "2023-10-27T00:00:00Z",
 "dateTo": "2023-10-28T00:00:00Z",
 "size": 50
}

try:
 resp = analytics_api.post_analytics_conversations_details_query(body=body)
 print(f"Got {len(resp.entities)} entities")
except Exception as e:
 print(f"Error: {e}")

The first call works fine. I get 50 entities back. The response object includes a nextPageUri field. My assumption was that I should just fetch that URI for the next batch. But when I try to use the SDK helper for pagination, it seems to expect pageNumber increments.

If I manually increment pageNumber in the request body for the next call, I get a 400 Bad Request. The error message says something like Invalid parameter: pageNumber is not supported for this view type or similar. It feels like this endpoint might be cursor-based only, but the SDK examples show page numbers.

Is there a specific method in the Python SDK to handle the cursor automatically? Or do I need to manually parse the nextPageUri and make raw HTTP GET requests for subsequent pages? I’ve tried using resp.next_page_uri but the SDK’s get_analytics_conversations_details_query method doesn’t seem to accept a URI directly. It wants a body dict.

Any code examples on how to loop through all pages for this specific endpoint would be great. I don’t want to miss any data in the middle.