📤 Chatting
Get messages in a chat
DEPRECATED. Use "GET /api/chats/{id}/messages" instead
get/api/messages
Request
- Base URL: http://localhost:3000
- URL: http://localhost:3000/api/messages
- Auth: API key in header X-Api-Key
Query parameters
sortBy'timestamp' | 'messageTimestamp'
Sort by field
sortOrder'desc' | 'asc'
Sort order - <b>desc</b>ending (Z => A, New first) or <b>asc</b>ending (A => Z, Old first)
downloadMediaboolean
Download media for messages
downloadMediaMimetypesstring[]
Download only media with these mimetypes (prefix match)
mergeboolean
Example:true
Merge LID (@lid) and phone-number (@c.us) chats referencing the same contact
chatIdstring required
Example:11111111111@c.us
sessionstring required
limitnumber required
offsetnumber
filter.timestamp.ltenumber
Filter messages before this timestamp (inclusive)
filter.timestamp.gtenumber
Filter messages after this timestamp (inclusive)
filter.fromMeboolean
From me filter (by default shows all messages)
filter.ack'ERROR' | 'PENDING' | 'SERVER' | 'DEVICE' | 'READ' | 'PLAYED'
Filter messages by acknowledgment status
Response
Example response
[
{
"id": "false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA",
"timestamp": 1666943582,
"from": "11111111111@c.us",
"source": "api",
"to": "11111111111@c.us",
"media": {
"url": "http://localhost:3000/api/files/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga",
"mimetype": "audio/jpeg",
"filename": "example.pdf",
"s3": {
"Bucket": "my-bucket",
"Key": "default/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga"
}
},
"mediaUrl": "http://localhost:3000/api/files/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga",
"replyTo": {
"id": "AAAAAAAAAAAAAAAAAAAA",
"participant": "11111111111@c.us",
"body": "Hello!",
"media": {
"url": "http://localhost:3000/api/files/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga",
"mimetype": "audio/jpeg",
"filename": "example.pdf",
"s3": {
"Bucket": "my-bucket",
"Key": "default/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga"
}
}
}
}
]Changes
No recorded changes to this operation across all 1 revision of this API.