I’ve been trying to pull conversation detail data from the Genesys Cloud analytics endpoint, and the pagination logic is giving me a headache. The docs mention both page and pageSize parameters, but also hint at cursor-based navigation for larger datasets. I’m not sure which approach is actually stable or recommended for production scripts.
Here’s what I’ve got so far in Python using requests. It works for the first 100 records, but when I try to bump the page number, I just get duplicates or empty results depending on how I tweak the query params.
import requests
import json
headers = {
"Authorization": "Bearer " + access_token,
"Content-Type": "application/json"
}
body = {
"dateFrom": "2023-10-01T00:00:00.000Z",
"dateTo": "2023-10-01T23:59:59.999Z",
"viewId": "my_conversation_view_id",
"groupBy": "["interactionId"]
}
url = "https://api.eu-gb.genesiscloud.com/api/v2/analytics/conversations/details/query"
# First page
res = requests.post(url, headers=headers, json=body)
data = res.json()
print(f"Got {len(data.get('data', []))} records")
# Trying to get next page
body["page"] = 2
body["pageSize"] = 100
res2 = requests.post(url, headers=headers, json=body)
data2 = res2.json()
print(f"Got {len(data2.get('data', []))} records on page 2")
The second call returns 100 records again, but they look identical to the first batch. I checked the meta object in the response, and there’s no obvious cursor token like nextPageToken. Is this endpoint strictly page-based? If so, why does increasing page not give me the next chunk of unique data?
Also, I noticed some threads mentioning a cursor parameter, but it’s not listed in the official Swagger spec for this endpoint. Am I missing something, or is this just a limitation of the analytics API? I’d rather not write a script that pulls the same data twice if I can help it.