Ran into a weird issue today with…
I am currently building a custom reporting pipeline that requires fetching detailed interaction metadata for voice conversations that occurred over 24 hours ago. My initial implementation relied on the /api/v2/conversations endpoint, specifically using the GET /api/v2/conversations/{conversationId} method to retrieve full transcript and metric details. However, I noticed that for conversations older than 24 hours, the metrics object within the response payload is significantly truncated. Specifically, fields like talk, hold, and wait durations are either missing or return null, even though the conversation status is closed.
According to the documentation, the /api/v2/conversations endpoint is intended for real-time or near-real-time data, while /api/v2/analytics/conversations is designed for historical reporting. I switched my code to use the analytics endpoint:
import requests
headers = {
'Authorization': 'Bearer <access_token>',
'Content-Type': 'application/json'
}
params = {
'dateFrom': '2023-10-01T00:00:00.000Z',
'dateTo': '2023-10-31T23:59:59.999Z',
'view': 'summary'
}
response = requests.get('https://api.mypurecloud.com/api/v2/analytics/conversations/summary', headers=headers, params=params)
The response from the analytics endpoint returns a 200 OK but the JSON structure is entirely different. It aggregates data across all conversations rather than providing the granular, per-conversation detail I need for my specific use case. I tried appending ?filter=conversationId:12345 to the analytics URL, but this results in a 400 Bad Request because the summary view does not support single-conversation filtering in this manner.
Is there a specific query parameter or a different sub-endpoint under /api/v2/analytics/conversations that allows me to fetch detailed, non-aggregated metrics for a single historical conversation? Or is the /api/v2/conversations endpoint simply unreliable for data older than 24 hours, forcing me to implement a custom storage solution for metrics at close time?