Obter Conversa por ID
API Reference
- Autenticação
- Agentes
- Conversas
- Conhecimentos
- Fontes de Conhecimentos
Obter Conversa por ID
Retorna detalhes completos de uma conversa específica pelo seu ID.
GET
/
conversations
/
{id}
curl --request GET \
--url https://dash.superagentes.ai/api/conversations/{id} \
--header 'Authorization: Bearer <token>'
{
"id": "conversation-id-1",
"title": "Conversa com Cliente",
"status": "UNRESOLVED",
"channel": "whatsapp",
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z",
"agent": {
"id": "agent-id",
"name": "Nome do Agente",
"iconUrl": "https://exemplo.com/icon.png"
},
"messages": [
{
"id": "message-id-1",
"text": "Olá, como posso ajudar?",
"from": "agent",
"createdAt": "2023-01-01T00:00:00.000Z",
"read": true,
"eval": "GOOD"
},
{
"id": "message-id-2",
"text": "Preciso de ajuda com meu pedido",
"from": "human",
"createdAt": "2023-01-01T00:05:00.000Z",
"read": false,
"eval": null
}
],
"participants": [
{
"id": "participant-id-1",
"type": "user"
}
],
"participantsUsers": [
{
"id": "user-id-1",
"name": "Nome do Usuário"
}
],
"participantsVisitors": [
{
"id": "visitor-id-1",
"contact": {
"id": "contact-id-1",
"firstName": "Nome",
"lastName": "Sobrenome"
}
}
],
"participantsContacts": [
{
"id": "contact-id-1",
"firstName": "Nome",
"lastName": "Sobrenome",
"email": "email@exemplo.com"
}
]
}
Obter Conversa por ID
Este endpoint permite obter detalhes completos de uma conversa específica pelo seu ID. Inclui todas as mensagens e informações sobre os participantes.
Casos de uso
- Visualizar o histórico completo de uma conversa
- Analisar a interação entre o agente e o usuário
- Verificar o status e detalhes de uma conversa específica
- Acessar todas as mensagens trocadas em uma conversa
Exemplos de código
const getConversation = async (conversationId) => {
const response = await fetch(`https://dash.superagentes.ai/api/conversations/${conversationId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${seu_token_jwt}`,
'Content-Type': 'application/json'
}
});
const data = await response.json();
return data;
};
Exemplo de resposta
{
"id": "conversation-id-1",
"title": "Conversa com Cliente",
"status": "UNRESOLVED",
"channel": "whatsapp",
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z",
"agent": {
"id": "agent-id",
"name": "Nome do Agente",
"iconUrl": "https://exemplo.com/icon.png"
},
"messages": [
{
"id": "message-id-1",
"text": "Olá, como posso ajudar?",
"from": "agent",
"createdAt": "2023-01-01T00:00:00.000Z",
"read": true,
"eval": "GOOD"
},
{
"id": "message-id-2",
"text": "Preciso de ajuda com meu pedido",
"from": "human",
"createdAt": "2023-01-01T00:05:00.000Z",
"read": false,
"eval": null
}
],
"participants": [
{
"id": "participant-id-1",
"type": "user"
}
],
"participantsUsers": [
{
"id": "user-id-1",
"name": "Nome do Usuário"
}
],
"participantsVisitors": [
{
"id": "visitor-id-1",
"contact": {
"id": "contact-id-1",
"firstName": "Nome",
"lastName": "Sobrenome"
}
}
],
"participantsContacts": [
{
"id": "contact-id-1",
"firstName": "Nome",
"lastName": "Sobrenome",
"email": "email@exemplo.com"
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
ID da conversa
Response
200
application/json
Detalhes da conversa
The response is of type object
.
curl --request GET \
--url https://dash.superagentes.ai/api/conversations/{id} \
--header 'Authorization: Bearer <token>'
{
"id": "conversation-id-1",
"title": "Conversa com Cliente",
"status": "UNRESOLVED",
"channel": "whatsapp",
"createdAt": "2023-01-01T00:00:00.000Z",
"updatedAt": "2023-01-01T00:00:00.000Z",
"agent": {
"id": "agent-id",
"name": "Nome do Agente",
"iconUrl": "https://exemplo.com/icon.png"
},
"messages": [
{
"id": "message-id-1",
"text": "Olá, como posso ajudar?",
"from": "agent",
"createdAt": "2023-01-01T00:00:00.000Z",
"read": true,
"eval": "GOOD"
},
{
"id": "message-id-2",
"text": "Preciso de ajuda com meu pedido",
"from": "human",
"createdAt": "2023-01-01T00:05:00.000Z",
"read": false,
"eval": null
}
],
"participants": [
{
"id": "participant-id-1",
"type": "user"
}
],
"participantsUsers": [
{
"id": "user-id-1",
"name": "Nome do Usuário"
}
],
"participantsVisitors": [
{
"id": "visitor-id-1",
"contact": {
"id": "contact-id-1",
"firstName": "Nome",
"lastName": "Sobrenome"
}
}
],
"participantsContacts": [
{
"id": "contact-id-1",
"firstName": "Nome",
"lastName": "Sobrenome",
"email": "email@exemplo.com"
}
]
}