curl -X GET "https://api.leavo.ai/backend/messages?channel_id=uuid&remote_jid=5511999999999@s.whatsapp.net&limit=20" \
-H "Authorization: Bearer sua_chave_aqui"
const params = new URLSearchParams({
channel_id: 'uuid-do-canal',
remote_jid: '5511999999999@s.whatsapp.net',
limit: '20'
});
const response = await fetch(
`https://api.leavo.ai/backend/messages?${params}`,
{
headers: {
'Authorization': 'Bearer sua_chave_aqui'
}
}
);
const messages = await response.json();
import requests
response = requests.get(
'https://api.leavo.ai/backend/messages',
params={
'channel_id': 'uuid-do-canal',
'remote_jid': '5511999999999@s.whatsapp.net',
'limit': 20
},
headers={'Authorization': 'Bearer sua_chave_aqui'}
)
messages = response.json()
[
{
"id": "msg-uuid-1",
"content": "Olá, gostaria de mais informações",
"role": "user",
"message_type": "text",
"timestamp": "2024-01-15T10:30:00Z",
"status": "read"
},
{
"id": "msg-uuid-2",
"content": "Olá! Claro, posso ajudar. Qual produto você tem interesse?",
"role": "assistant",
"message_type": "text",
"timestamp": "2024-01-15T10:30:05Z",
"status": "delivered"
},
{
"id": "msg-uuid-3",
"content": "",
"role": "user",
"message_type": "image",
"url": "https://storage.leavo.ai/images/abc123.jpg",
"timestamp": "2024-01-15T10:31:00Z",
"status": "read"
}
]
Mensagens
Buscar Mensagens
Retorna mensagens de uma conversa específica
GET
/
backend
/
messages
curl -X GET "https://api.leavo.ai/backend/messages?channel_id=uuid&remote_jid=5511999999999@s.whatsapp.net&limit=20" \
-H "Authorization: Bearer sua_chave_aqui"
const params = new URLSearchParams({
channel_id: 'uuid-do-canal',
remote_jid: '5511999999999@s.whatsapp.net',
limit: '20'
});
const response = await fetch(
`https://api.leavo.ai/backend/messages?${params}`,
{
headers: {
'Authorization': 'Bearer sua_chave_aqui'
}
}
);
const messages = await response.json();
import requests
response = requests.get(
'https://api.leavo.ai/backend/messages',
params={
'channel_id': 'uuid-do-canal',
'remote_jid': '5511999999999@s.whatsapp.net',
'limit': 20
},
headers={'Authorization': 'Bearer sua_chave_aqui'}
)
messages = response.json()
[
{
"id": "msg-uuid-1",
"content": "Olá, gostaria de mais informações",
"role": "user",
"message_type": "text",
"timestamp": "2024-01-15T10:30:00Z",
"status": "read"
},
{
"id": "msg-uuid-2",
"content": "Olá! Claro, posso ajudar. Qual produto você tem interesse?",
"role": "assistant",
"message_type": "text",
"timestamp": "2024-01-15T10:30:05Z",
"status": "delivered"
},
{
"id": "msg-uuid-3",
"content": "",
"role": "user",
"message_type": "image",
"url": "https://storage.leavo.ai/images/abc123.jpg",
"timestamp": "2024-01-15T10:31:00Z",
"status": "read"
}
]
Query Parameters
string
obrigatório
UUID do canal
string
obrigatório
JID do WhatsApp (ex:
5511999999999@s.whatsapp.net)integer
padrão:"50"
Limite de mensagens a retornar
integer
padrão:"0"
Deslocamento para paginação
Response
Message[]
Lista de mensagens ordenadas por timestamp
Mostrar Propriedades da Mensagem
Mostrar Propriedades da Mensagem
curl -X GET "https://api.leavo.ai/backend/messages?channel_id=uuid&remote_jid=5511999999999@s.whatsapp.net&limit=20" \
-H "Authorization: Bearer sua_chave_aqui"
const params = new URLSearchParams({
channel_id: 'uuid-do-canal',
remote_jid: '5511999999999@s.whatsapp.net',
limit: '20'
});
const response = await fetch(
`https://api.leavo.ai/backend/messages?${params}`,
{
headers: {
'Authorization': 'Bearer sua_chave_aqui'
}
}
);
const messages = await response.json();
import requests
response = requests.get(
'https://api.leavo.ai/backend/messages',
params={
'channel_id': 'uuid-do-canal',
'remote_jid': '5511999999999@s.whatsapp.net',
'limit': 20
},
headers={'Authorization': 'Bearer sua_chave_aqui'}
)
messages = response.json()
[
{
"id": "msg-uuid-1",
"content": "Olá, gostaria de mais informações",
"role": "user",
"message_type": "text",
"timestamp": "2024-01-15T10:30:00Z",
"status": "read"
},
{
"id": "msg-uuid-2",
"content": "Olá! Claro, posso ajudar. Qual produto você tem interesse?",
"role": "assistant",
"message_type": "text",
"timestamp": "2024-01-15T10:30:05Z",
"status": "delivered"
},
{
"id": "msg-uuid-3",
"content": "",
"role": "user",
"message_type": "image",
"url": "https://storage.leavo.ai/images/abc123.jpg",
"timestamp": "2024-01-15T10:31:00Z",
"status": "read"
}
]
⌘I