Relatórios
Obter Estatísticas Conversacionais
Retorna estatísticas de conversas por host e período.
Retorna totais de serviços, mensagens, distribuição por canais e histórico por mês e dia.
Endpoint
POST /api/externalAPIs/public/tolkyReasoning/reports/getConversationalStats
Parâmetros
| Parâmetro | Tipo | Descrição |
|---|---|---|
hostId | string (UUID) | UUID do host (obrigatório) |
startDate | string (date-time) | Data inicial do período (obrigatório) |
endDate | string (date-time) | Data final do período (obrigatório) |
Exemplo
curl -X POST \
'{{BASE_URL}}/api/externalAPIs/public/tolkyReasoning/reports/getConversationalStats' \
-H 'Content-Type: application/json' \
-d '{
"hostId": "uuid-do-host",
"startDate": "2025-01-01",
"endDate": "2025-01-31"
}'
Resposta
{
"code": 200,
"message": "OK",
"data": [
{
"total_contracted_services": 0,
"total_services": 2895,
"total_messages": 52834,
"total_tickets": 0,
"total_messages_sent_by_avatar": 26401,
"total_messages_received_by_user": 26433,
"total_solved_tickets": 0,
"total_opened_tickets": 0,
"total_services_after_hours": 1450,
"total_messages_after_hours": 38795,
"total_messages_responder_manager": 0,
"services_by_channels": [
{
"platform": "web",
"total_services": "10"
},
{
"platform": "api_reasoning",
"total_services": "1161"
},
{
"platform": "api",
"total_services": "1724"
}
],
"history_months": [
{
"mês": "2025-03-01T03:00:00.000Z",
"total_conversations": "272",
"total_messages": "5994",
"total_tickets": "0"
}
],
"history_days": [
{
"dia": "2025-05-01T03:00:00.000Z",
"total_conversations": "251",
"total_messages": "6121",
"total_tickets": "0"
}
]
}
]
}
Erros
| Código | Descrição |
|---|---|
400 | Campos obrigatórios ausentes ou inválidos |
401 | Token inválido ou ausente |
404 | Dados não encontrados |
500 | Erro interno do servidor |