Mercado Libre - Get Messages
Description
Section titled “Description”This module allows querying post-sale conversation messages with buyers, either from a specific order or listing recent conversations.
Configuration
Section titled “Configuration”Credentials
Section titled “Credentials”This module requires Mercado Libre (OAuth) credentials with the following fields:
| Field | Description |
|---|---|
access_token | Valid OAuth access token |
Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
credentials_id | string | Yes | Credentials ID |
pack_id | string | No | Pack/cart ID |
order_id | string | No | Order ID |
user_id | string | No | User ID |
role | string | No | seller or buyer |
status | string | No | unread, unanswered |
tag | string | No | post_sale, pre_sale |
limit | number | No | Messages per page |
offset | number | No | Offset |
Message Statuses
Section titled “Message Statuses”| Value | Description |
|---|---|
unread | Unread |
unanswered | Unanswered |
Conversation Tags
Section titled “Conversation Tags”| Value | Description |
|---|---|
post_sale | Post-sale messages |
pre_sale | Pre-sale questions |
Output
Section titled “Output”{ "success": true, "messages": [ { "id": "abc123", "from": { "user_id": 123456789, "role": "buyer" }, "to": { "user_id": 987654321, "role": "seller" }, "text": "Hola, cuando llega mi pedido?", "date_created": "2024-01-15T10:30:00.000-03:00", "status": "unread" } ], "pack_id": "2000001234567890", "conversation_status": {...}, "message": "5 messages retrieved"}Usage Example
Section titled “Usage Example”Messages from an order
Section titled “Messages from an order”{ "credentials_id": "meli_cuenta", "order_id": "2000001234567890"}Messages from a pack
Section titled “Messages from a pack”{ "credentials_id": "meli_cuenta", "pack_id": "2000001234567890"}Unread messages
Section titled “Unread messages”{ "credentials_id": "meli_cuenta", "status": "unread"}Unanswered messages
Section titled “Unanswered messages”{ "credentials_id": "meli_cuenta", "status": "unanswered", "role": "seller"}Post-sale conversations
Section titled “Post-sale conversations”{ "credentials_id": "meli_cuenta", "tag": "post_sale", "limit": 50}Message Fields
Section titled “Message Fields”| Field | Description |
|---|---|
id | Unique message ID |
from | Sender (user_id, role) |
to | Recipient |
text | Message content |
date_created | Send date |
status | Status (read, unread) |
attachments | File attachments |
Example Workflows
Section titled “Example Workflows”Automatic response
Section titled “Automatic response”[Message webhook] -> [MeliGetMessages] -> [Classify] -> [MeliSendMessage response]Message monitor
Section titled “Message monitor”[Schedule every 5min] -> [MeliGetMessages unread] -> [Alert if pending]Conversation analysis
Section titled “Conversation analysis”[MeliGetMessages order] -> [Analyze sentiment] -> [Classify satisfaction]Usage with ExecuteScript
Section titled “Usage with ExecuteScript”// Classify messages by urgencyconst mensajes = ctx.data.messages;
const clasificados = { urgente: [], normal: [], resuelto: []};
const palabrasUrgentes = ['urgente', 'problema', 'reclamo', 'devolucion', 'reembolso'];
mensajes.forEach(m => { const texto = m.text.toLowerCase();
if (palabrasUrgentes.some(p => texto.includes(p))) { clasificados.urgente.push(m); } else if (m.status === 'unread') { clasificados.normal.push(m); } else { clasificados.resuelto.push(m); }});
ctx.data = { total_mensajes: mensajes.length, urgentes: clasificados.urgente.length, pendientes: clasificados.normal.length, resueltos: clasificados.resuelto.length, mensajes_urgentes: clasificados.urgente};API Used
Section titled “API Used”- API: Mercado Libre Messaging API
- Endpoint:
GET /messages/packs/{pack_id}/sellers/{user_id} - Documentation: https://developers.mercadolibre.com/
- Messages are linked to orders or packs
- Response time affects customer service metrics
- Messages may include file attachments
- Conversation history is important for claims
- Deleted messages cannot be recovered
Related Nodes
Section titled “Related Nodes”- MeliSendMessage - Send messages to buyers
- MeliGetOrders - Get orders associated with messages
- MeliGetUser - Get buyer data