We are building a custom agent desktop extension using the Embeddable Client App SDK. The goal is to pull conversation aggregates for the last 24 hours so agents can review their wrap-up codes. We are using the genesyscloud-node-sdk in our backend service to fetch this data.
The issue is with the paging object. When we set pageSize to 50, we expect pageCount to reflect the total number of pages available based on the total entity count. Instead, pageCount always returns 1, even when we know there are more than 50 interactions.
Here is the code snippet we are using:
const analyticsApi = new platformClient.AnalyticsApi();
const body = {
pageSize: 50,
pageNumber: 1,
dateRange: {
rangeType: 'relative',
type: 'last',
duration: 1440 // minutes
},
entities: [
{
id: 'user_id_placeholder',
type: 'user'
}
]
};
const response = await analyticsApi.postAnalyticsConversationsAggregates({
body: body
});
console.log('Total Count:', response.body.totalCount);
console.log('Page Count:', response.body.pageCount);
console.log('Page Number:', response.body.pageNumber);
The output looks like this:
Total Count: 120
Page Count: 1
Page Number: 1
We checked the API documentation. It says pageCount is the total number of pages. We tried setting pageNumber to 2 in the request body, but the response still only returns the first 50 records and pageCount stays at 1. We also tried using the X-Genesys-PageToken header, but that seems to be for cursor-based paging in other endpoints.
Is there a specific way to handle paging for the /api/v2/analytics/conversations/aggregates endpoint? We need to loop through all pages to get the full dataset. Any help would be appreciated.