# getChatLastMessages
Description: Get a list of chat messages.
The command is used to get a certain number of messages from the chat, starting from the message with the given index.
Request example:
{
"method": "getChatLastMessages",
"requestId" : "1",
"chatId": "b3b6e79f00677a63b545791fafca80d1119e56c3",
"beginNumber": 0,
"count": 10
}
Response example:
{
"method": "getChatLastMessages",
"requestId" : "1",
"messages": [
{
"text": "hello",
"time": 1661428897,
"peerId": "user@some.server",
"direction": 0
},
{
"text": "hi",
"time": 1661428876,
"peerId": "user@some.server",
"direction": 0
}
],
"result": true
}
Parameter description:
chatId
— Unique chat identifierbeginNumber
— Number starting from which messages are sent.count
— Message countmessages
— the list of messagestext
— Message text.time
— the timestamp indicating when the message was createdpeerId
— Unique identifier (TrueConf ID) of a user who sent or received a file.direction
— the type of message. The following types are possible:0
— Incoming1
— Outgoing
requestId
- a unique request identifier. You can learn more about it here.
See also: