Trying to paginate through conversation details using the Genesys Cloud Analytics API in our Android app. I’m using the Kotlin SDK to hit GET /api/v2/analytics/conversations/details. The docs mention a paging object with pageSize and pageNumber, but the behavior feels off.
Here’s the setup:
val query = AnalyticsConversationsDetailsQuery(
dateFrom = "2023-10-01T00:00:00.000Z",
dateTo = "2023-10-01T23:59:59.999Z",
pageSize = 100,
pageNumber = 2
)
When I set pageNumber = 2, I get the second block of 100 records. That makes sense. But if I change pageSize to 50 and keep pageNumber = 2, I don’t get the 51st-100th records overall. I get the 51st-100th records based on a 100-item page size? Or is it purely based on the new page size?
It seems like pageNumber is relative to the pageSize defined in the first request if I’m reusing the same query object, but I’m creating a new query each time. I’m getting duplicate records when I increment pageNumber without adjusting pageSize in subsequent calls within the same session. Is there a specific token or cursor I should be using instead? The response has a nextPage link, but I’d prefer to construct the request manually for better control over retries. What’s the correct way to handle the paging object here?