Get Chat History
curl --request GET \
--url https://api.jelou.ai/v1/external/messages/history/{botId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.jelou.ai/v1/external/messages/history/{botId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.jelou.ai/v1/external/messages/history/{botId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jelou.ai/v1/external/messages/history/{botId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.jelou.ai/v1/external/messages/history/{botId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.jelou.ai/v1/external/messages/history/{botId}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jelou.ai/v1/external/messages/history/{botId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"pagination": {
"limit": 123,
"page": 123,
"total": 123,
"offset": 123,
"totalPages": 123
},
"_metadata": {},
"results": [
{
"recipient": {
"id": "<string>",
"names": "<string>"
},
"sender": {
"id": "<string>",
"name": "<string>",
"type": "<string>"
},
"messageId": "<string>",
"status": "<string>",
"bubble": {
"type": "<string>",
"text": "<string>",
"mediaUrl": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z"
}
]
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}Conversaciones
Historial de chat
Consulta el historial de mensajes de un bot
GET
/
v1
/
external
/
messages
/
history
/
{botId}
Get Chat History
curl --request GET \
--url https://api.jelou.ai/v1/external/messages/history/{botId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.jelou.ai/v1/external/messages/history/{botId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.jelou.ai/v1/external/messages/history/{botId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.jelou.ai/v1/external/messages/history/{botId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.jelou.ai/v1/external/messages/history/{botId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.jelou.ai/v1/external/messages/history/{botId}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jelou.ai/v1/external/messages/history/{botId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"pagination": {
"limit": 123,
"page": 123,
"total": 123,
"offset": 123,
"totalPages": 123
},
"_metadata": {},
"results": [
{
"recipient": {
"id": "<string>",
"names": "<string>"
},
"sender": {
"id": "<string>",
"name": "<string>",
"type": "<string>"
},
"messageId": "<string>",
"status": "<string>",
"bubble": {
"type": "<string>",
"text": "<string>",
"mediaUrl": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z"
}
]
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}{
"message": "<string>",
"statusMessage": "<string>",
"status": 123,
"error": {
"code": "<string>",
"key": "<string>",
"description": "<string>",
"developerMessages": {},
"clientMessages": {}
},
"validationError": {}
}Obtén el historial de conversaciones de un bot para auditar interacciones, analizar métricas o depurar flujos. Este endpoint retorna los mensajes enviados y recibidos con soporte para paginación y filtros de tiempo.
Endpoint
GET https://api.jelou.ai/v1/external/messages/history/{botId}
Parámetros de ruta
| Campo | Ubicación | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| botId | Path | string | Sí | Identificador único del bot del que deseas consultar el historial. |
Parámetros de consulta
| Campo | Ubicación | Tipo | Requerido | Valor por defecto | Descripción |
|---|---|---|---|---|---|
| limit | Query | integer | No | 10 | Número de mensajes a solicitar. Máximo: 50. |
| page | Query | integer | No | 1 | Número de página. |
| startAt | Query | date | No | - | Fecha de inicio del rango a consultar. Formato ISO 8601. |
| endAt | Query | date | No | - | Fecha fin del rango a consultar. Formato ISO 8601. |
| clientId | Query | string | No | - | Filtra el historial por un clientId específico asociado a tus integraciones. |
| messageId | Query | string | No | - | Devuelve la conversación que contiene el mensaje con este identificador. |
Si omites los campos opcionales, la API aplicará valores predeterminados para entregar la primera página con los mensajes más recientes.
Ejemplos de solicitud
Consulta básica
curl --request GET \
--url 'https://api.jelou.ai/v1/external/messages/history/BOT_ID?limit=10&page=1' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}'
Con filtro de fechas
curl --request GET \
--url 'https://api.jelou.ai/v1/external/messages/history/BOT_ID?limit=20&page=1&startAt=2025-01-01T00:00:00.000Z&endAt=2025-01-31T23:59:59.000Z' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}'
Con filtro de cliente
curl --request GET \
--url 'https://api.jelou.ai/v1/external/messages/history/BOT_ID?limit=10&page=1&clientId=CLIENT_ID' \
--header 'Authorization: Basic {{Base64EncodedUsername:Password}}'
Respuestas
200 - Respuesta exitosa
200 - Respuesta exitosa
{
"pagination": {
"limit": 10,
"page": 1,
"total": 1,
"offset": 0,
"totalPages": 1
},
"_metadata": {},
"results": [
{
"recipient": {
"id": "RECIPIENT_ID",
"names": "Cliente Ejemplo"
},
"sender": {
"id": "BOT_ID",
"name": "Mi Bot",
"type": "WhatsApp"
},
"by": "bot",
"messageId": "msg-12345-67890-4a38-abcde-fghij",
"status": "DELIVERED_USER",
"bubble": {
"type": "TEXT",
"text": "Hola, bienvenido a Jelou"
},
"createdAt": "2025-01-15T10:30:00.000Z"
}
]
}
401 - Unauthorized
401 - Unauthorized
{
"message": "Authentication failed"
}
404 - Not Found
404 - Not Found
{
"message": ["The Bot could not be found at the moment."],
"statusMessage": "failed",
"status": 0,
"error": {
"code": "E1019",
"key": "BOT_NOT_FOUND",
"description": "Error to be thrown when trying to get a Bot.",
"developerMessages": {
"es": "El botId no se encuentra en la base de datos o ha sido eliminado.",
"en": "The botId is not found in the database or has been deleted."
},
"clientMessages": {
"es": "El Bot no se pudo encontrar por el momento.",
"en": "The Bot could not be found at the moment."
}
}
}
422 - Unprocessable Entity
422 - Unprocessable Entity
{
"message": ["Los valores ingresados no son correctos."],
"statusMessage": "failed",
"status": 0,
"error": {
"code": "E0422",
"key": "VALIDATOR_ERROR",
"description": "Error to be thrown when cannot process request because of incoming values",
"developerMessages": {
"es": "Los valores del request no son correctos para ser procesados.",
"en": "The request values are not correct for processing."
},
"clientMessages": {
"es": "Los valores ingresados no son correctos.",
"en": "The values entered are not correct."
}
},
"validationError": {
"startAt": [
{
"es": "el campo startAt debe ser una fecha",
"en": "the startAt field must be a Date"
}
]
}
}
500 - Internal Server Error
500 - Internal Server Error
{
"message": ["We are having trouble processing your request. Please try again later."],
"statusMessage": "failed",
"status": 0,
"error": {
"code": "E0000",
"key": "UNKNOWN_ERROR",
"description": "Error to be thrown when it couldn't be determined the reason of failure",
"developerMessages": {
"es": "Error inesperado ocurrido, revisar logs.",
"en": "Unexpected error occurred, check logs."
},
"clientMessages": {
"es": "Estamos teniendo problemas procesando la solicitud. Por favor intenta más tarde.",
"en": "We are having trouble processing your request. Please try again later."
}
}
}
Detalle de la respuesta
Objeto pagination
| Campo | Tipo | Descripción |
|---|---|---|
| limit | integer | Número de registros por página. |
| page | integer | Página actual. |
| total | integer | Total de registros. |
| offset | integer | Desplazamiento desde el inicio. |
| totalPages | integer | Total de páginas disponibles. |
Objeto results
| Campo | Tipo | Descripción |
|---|---|---|
| recipient | object | Información del destinatario (id, names). |
| sender | object | Información del remitente (id, name, type). |
| by | string | Indica quién envió el mensaje: bot o user. |
| messageId | string | Identificador único del mensaje. |
| status | string | Estado del mensaje: DELIVERED_USER, DELIVERED_CHANNEL, READ, etc. |
| bubble | object | Contenido del mensaje (type, text, mediaUrl, etc.). |
| createdAt | date | Fecha de creación del mensaje en formato ISO 8601. |
Límites y restricciones
Límites importantes:
- limit: Valor máximo permitido es
50 - page: Debe ser un número entero positivo
- startAt/endAt: Deben estar en formato ISO 8601 (ej:
2025-01-15T10:30:00.000Z)
Autorizaciones
Basic authentication using Base64 encoded clientId:clientSecret
Parámetros de ruta
Parámetros de consulta
Rango requerido:
x <= 50¿Esta página le ayudó?
⌘I