getChatLastMessages

TrueConfAbout 1 min

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 - a unique identifier of the user (TrueConf ID) of the sender or receiver

  • direction β€” the type of message. The following types are possible:

    • 0 β€” Incoming

    • 1 β€” Outgoing

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

See also: