I’m building a Kotlin microservice that needs to track the current state of web messaging sessions. The documentation is a bit vague on when to hit the core conversations API versus the analytics API.
My initial thought was to use the analytics endpoint because I need some historical context, but I noticed the data there seems delayed. When I call the conversation details query endpoint with a request body like this:
POST /api/v2/analytics/conversations/details/query
{
"dateRange": {
"from": "2023-10-27T12:00:00Z",
"to": "2023-10-27T13:00:00Z"
}
}
The response takes a few seconds to come back, and the total count doesn’t match the live dashboard. If I switch to the core conversations API to list active conversations, I get an instant response with accurate state values like ACTIVE or WRAPPED_UP.
Is the analytics API strictly for batch reporting, or can I rely on it for near-real-time polling? I don’t want to hammer the core conversations API if analytics is actually up-to-date enough for my use case. The latency on the analytics call is killing my thread pool.