{ "id": "conversation-id-1", "title": "Conversa com Cliente", "contactName": "Nome do Cliente", "phoneNumber": "+5511999999999", "channel": "whatsapp", "agentName": "Nome do Agente", "createdAt": "2024-01-01T00:00:00.000Z", "messages": [ { "id": "message-id-1", "from": "agent", "text": "Olá, como posso ajudar?", "timestamp": "2024-01-01T00:00:00.000Z", "formattedTimestamp": "01/01/2024 00:00", "senderName": "Nome do Agente", "attachments": [] } ] }
Este endpoint permite gerar uma visualização limpa e imprimível de uma conversa do usuário em formato HTML ou JSON.
const exportUserConversation = async (conversationId, format = 'html') => { const response = await fetch(`https://dash.superagentes.ai/api/user-conversations/export/${conversationId}?format=${format}`, { method: 'GET', headers: { 'Authorization': `Bearer ${seu_token_jwt}`, 'Content-Type': 'application/json' } }); if (format === 'html') { const html = await response.text(); return html; } else { const data = await response.json(); return data; } };