Conversations
Obtener mensajes
Obtener los mensajes de una conversación específica con paginación.
GET
/
api
/
v2
/
conversations
/
{id}
/
messages
curl -X GET "https://app.horneross.com/api/v2/conversations/conv_abc123/messages?limit=50" \
-H "Authorization: Bearer sk_live_xxx"
async function getMessages(conversationId, options = {}) {
const params = new URLSearchParams(options);
const response = await fetch(
`https://app.horneross.com/api/v2/conversations/${conversationId}/messages?${params}`,
{
headers: {
'Authorization': 'Bearer sk_live_xxx',
},
}
);
return response.json();
}
const result = await getMessages('conv_abc123', { limit: 50 });
for (const msg of result.messages) {
console.log(`[${msg.role}] ${msg.content}`);
}
import requests
def get_messages(conversation_id, limit=100, offset=0):
response = requests.get(
f'https://app.horneross.com/api/v2/conversations/{conversation_id}/messages',
headers={'Authorization': 'Bearer sk_live_xxx'},
params={'limit': limit, 'offset': offset}
)
return response.json()
result = get_messages('conv_abc123', limit=50)
for msg in result['messages']:
print(f"[{msg['role']}] {msg['content']}")
{
"messages": [
{
"id": "msg_001",
"role": "user",
"content": "Hola, necesito ayuda con mi pedido",
"from": "human",
"type": "TEXT",
"eval": null,
"createdAt": "2024-01-21T10:00:00Z"
},
{
"id": "msg_002",
"role": "assistant",
"content": "¡Hola! Con gusto te ayudo. ¿Podrías darme el número de pedido?",
"from": "agent",
"type": "TEXT",
"eval": "good",
"metadata": {
"model": "gpt-4o",
"sources": ["FAQ Pedidos"]
},
"createdAt": "2024-01-21T10:00:05Z"
},
{
"id": "msg_003",
"role": "user",
"content": "Mi pedido es #12345",
"from": "human",
"type": "TEXT",
"attachments": [
{
"name": "captura.png",
"url": "https://storage.horneross.com/files/captura.png",
"size": 45000,
"mimeType": "image/png"
}
],
"createdAt": "2024-01-21T10:01:00Z"
}
],
"conversation": {
"id": "conv_abc123",
"title": "Consulta de pedido",
"channel": "website",
"status": "UNRESOLVED",
"agentId": "ag_xyz789",
"agent": {
"id": "ag_xyz789",
"name": "Agente de Soporte",
"iconUrl": "https://storage.horneross.com/icons/support.png",
"description": "Agente especializado en soporte",
"currentVersion": {
"id": "ver_001",
"modelName": "gpt-4o",
"temperature": 0.7
}
},
"metadata": {},
"createdAt": "2024-01-21T10:00:00Z",
"updatedAt": "2024-01-21T10:01:00Z"
},
"pagination": {
"limit": 100,
"offset": 0,
"total": 3,
"hasMore": false
}
}
{
"error": "conversation_org_mismatch"
}
Endpoint
GET /api/v2/conversations/{id}/messages
Path Parameters
Headers
Query Parameters
curl -X GET "https://app.horneross.com/api/v2/conversations/conv_abc123/messages?limit=50" \
-H "Authorization: Bearer sk_live_xxx"
async function getMessages(conversationId, options = {}) {
const params = new URLSearchParams(options);
const response = await fetch(
`https://app.horneross.com/api/v2/conversations/${conversationId}/messages?${params}`,
{
headers: {
'Authorization': 'Bearer sk_live_xxx',
},
}
);
return response.json();
}
const result = await getMessages('conv_abc123', { limit: 50 });
for (const msg of result.messages) {
console.log(`[${msg.role}] ${msg.content}`);
}
import requests
def get_messages(conversation_id, limit=100, offset=0):
response = requests.get(
f'https://app.horneross.com/api/v2/conversations/{conversation_id}/messages',
headers={'Authorization': 'Bearer sk_live_xxx'},
params={'limit': limit, 'offset': offset}
)
return response.json()
result = get_messages('conv_abc123', limit=50)
for msg in result['messages']:
print(f"[{msg['role']}] {msg['content']}")
Response
Array de mensajes
Show Propiedades de cada mensaje
Show Propiedades de cada mensaje
Información de la conversación
{
"messages": [
{
"id": "msg_001",
"role": "user",
"content": "Hola, necesito ayuda con mi pedido",
"from": "human",
"type": "TEXT",
"eval": null,
"createdAt": "2024-01-21T10:00:00Z"
},
{
"id": "msg_002",
"role": "assistant",
"content": "¡Hola! Con gusto te ayudo. ¿Podrías darme el número de pedido?",
"from": "agent",
"type": "TEXT",
"eval": "good",
"metadata": {
"model": "gpt-4o",
"sources": ["FAQ Pedidos"]
},
"createdAt": "2024-01-21T10:00:05Z"
},
{
"id": "msg_003",
"role": "user",
"content": "Mi pedido es #12345",
"from": "human",
"type": "TEXT",
"attachments": [
{
"name": "captura.png",
"url": "https://storage.horneross.com/files/captura.png",
"size": 45000,
"mimeType": "image/png"
}
],
"createdAt": "2024-01-21T10:01:00Z"
}
],
"conversation": {
"id": "conv_abc123",
"title": "Consulta de pedido",
"channel": "website",
"status": "UNRESOLVED",
"agentId": "ag_xyz789",
"agent": {
"id": "ag_xyz789",
"name": "Agente de Soporte",
"iconUrl": "https://storage.horneross.com/icons/support.png",
"description": "Agente especializado en soporte",
"currentVersion": {
"id": "ver_001",
"modelName": "gpt-4o",
"temperature": 0.7
}
},
"metadata": {},
"createdAt": "2024-01-21T10:00:00Z",
"updatedAt": "2024-01-21T10:01:00Z"
},
"pagination": {
"limit": 100,
"offset": 0,
"total": 3,
"hasMore": false
}
}
{
"error": "conversation_org_mismatch"
}
Was this page helpful?
⌘I
curl -X GET "https://app.horneross.com/api/v2/conversations/conv_abc123/messages?limit=50" \
-H "Authorization: Bearer sk_live_xxx"
async function getMessages(conversationId, options = {}) {
const params = new URLSearchParams(options);
const response = await fetch(
`https://app.horneross.com/api/v2/conversations/${conversationId}/messages?${params}`,
{
headers: {
'Authorization': 'Bearer sk_live_xxx',
},
}
);
return response.json();
}
const result = await getMessages('conv_abc123', { limit: 50 });
for (const msg of result.messages) {
console.log(`[${msg.role}] ${msg.content}`);
}
import requests
def get_messages(conversation_id, limit=100, offset=0):
response = requests.get(
f'https://app.horneross.com/api/v2/conversations/{conversation_id}/messages',
headers={'Authorization': 'Bearer sk_live_xxx'},
params={'limit': limit, 'offset': offset}
)
return response.json()
result = get_messages('conv_abc123', limit=50)
for msg in result['messages']:
print(f"[{msg['role']}] {msg['content']}")
{
"messages": [
{
"id": "msg_001",
"role": "user",
"content": "Hola, necesito ayuda con mi pedido",
"from": "human",
"type": "TEXT",
"eval": null,
"createdAt": "2024-01-21T10:00:00Z"
},
{
"id": "msg_002",
"role": "assistant",
"content": "¡Hola! Con gusto te ayudo. ¿Podrías darme el número de pedido?",
"from": "agent",
"type": "TEXT",
"eval": "good",
"metadata": {
"model": "gpt-4o",
"sources": ["FAQ Pedidos"]
},
"createdAt": "2024-01-21T10:00:05Z"
},
{
"id": "msg_003",
"role": "user",
"content": "Mi pedido es #12345",
"from": "human",
"type": "TEXT",
"attachments": [
{
"name": "captura.png",
"url": "https://storage.horneross.com/files/captura.png",
"size": 45000,
"mimeType": "image/png"
}
],
"createdAt": "2024-01-21T10:01:00Z"
}
],
"conversation": {
"id": "conv_abc123",
"title": "Consulta de pedido",
"channel": "website",
"status": "UNRESOLVED",
"agentId": "ag_xyz789",
"agent": {
"id": "ag_xyz789",
"name": "Agente de Soporte",
"iconUrl": "https://storage.horneross.com/icons/support.png",
"description": "Agente especializado en soporte",
"currentVersion": {
"id": "ver_001",
"modelName": "gpt-4o",
"temperature": 0.7
}
},
"metadata": {},
"createdAt": "2024-01-21T10:00:00Z",
"updatedAt": "2024-01-21T10:01:00Z"
},
"pagination": {
"limit": 100,
"offset": 0,
"total": 3,
"hasMore": false
}
}
{
"error": "conversation_org_mismatch"
}
