Which pagination method is actually reliable for the conversations details query endpoint? I’m building a script to export call records for a date range and the docs are vague on the difference between cursor and pageToken here.
I tried using pageToken first. The first request works fine.
{
"dateFrom": "2023-10-01T00:00:00.000Z",
"dateTo": "2023-10-01T23:59:59.999Z",
"pageSize": 100
}
The response gives me a nextPageToken. I pass that in the second request. It returns data, but it overlaps with the first batch. Same conversation IDs appear in both sets. I checked the id field and it’s definitely a duplicate.
I switched to cursor. I set cursor to the value from the first response. The second request returns 404 Not Found. The error message says “Cursor not found”.
I’ve seen other endpoints use cursor-based pagination without issues. Is this endpoint broken for cursors? Or am I formatting the request body wrong? I’m sending it as JSON in the POST body.
Here is the curl I used for the second attempt:
curl -X POST https://api.mypurecloud.com/api/v2/analytics/conversations/details/query \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"dateFrom": "2023-10-01T00:00:00.000Z",
"dateTo": "2023-10-01T23:59:59.999Z",
"pageSize": 100,
"cursor": "eyJ0eXBlIjoiY29udGludWF0aW9uLWRldGFpbHMiLCJ2YWx1ZSI6IjE2OTYwMDAwMDAwMDAifQ=="
}'
The token looks valid. It’s base64. I decoded it and it matches the structure from the first response.
What am I missing? The overlap with pageToken is a dealbreaker for accurate reporting. I can’t have duplicate records in the export.