Trying to build a custom interval report using the postAnalyticsConversationsAggregatesQuery method in the Genesys Cloud TypeScript SDK. The goal is to get conversation counts grouped by 15-minute intervals over the last 24 hours. The query works fine when I hit the REST endpoint directly via Postman, but the SDK returns an empty entities array in the response.
Here’s the query payload I’m passing:
const query: Analytics.ConversationsAggregateQuery = {
view: 'conversation',
select: ['count()'],
groupBy: ['interval'],
timeFilter: {
type: 'relative',
from: -86400, // 24 hours ago
to: 0
},
interval: '15 minutes',
where: [
{
type: 'field',
path: 'conversationType',
operator: 'equals',
value: 'voice'
}
]
};
const response = await analyticsApi.postAnalyticsConversationsAggregatesQuery({
analyticsConversationsAggregateQuery: query
});
The response object has a 200 status, but response.body.entities is []. I’ve checked the timezone settings in the account, and they match the SDK client configuration. Is there a specific quirk with how the SDK serializes the interval parameter or the timeFilter object that causes this? The REST spec says interval should be a string like ‘15 minutes’, which is what I’m sending. Any ideas on why the SDK would return empty data while the raw HTTP call succeeds?