# 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 identifier

  • beginNumber — Number starting from which messages are sent.

  • count — Message count

  • messages — the list of messages

  • text — Message text.

  • time — the timestamp indicating when the message was created

  • peerId — Unique identifier (TrueConf ID) of a user who sent or received a file.

  • direction — the type of message. The following types are possible:

    • 0 — Incoming

    • 1 — Outgoing

  • requestId - a unique request identifier. You can learn more about it here.

See also: