Load History
    • Dark
      Light
    • PDF

    Load History

    • Dark
      Light
    • PDF

    Article summary

    Load room history. After the initial load, you can stream room messages.

    Payload Parameters

    Argument

    Example

    Required

    Description

    roomId

    64a1f373376181965ab77f54

    Required

    The room ID.

    timestamp

    null

    Required

    The newest message timestamp date (or null) to only retrieve messages before this time.

    quantity

    50

    Required

    The quantity of results to be returned.

    date

    { "$date": 1480377601 }

    Required

    The date of the last time the client got data for the room.

    Example call

    Request of the latest 50 messages:

    {
        "msg": "method",
        "method": "loadHistory",
        "id": "42",
        "params": [ "64e37db1fedadc25c854843d", { "$date": 1480377205 }, 50, { "$date": 1480377601 } ]
    }

    Request of the latest 50 messages, using pagination:

    {
        "msg": "method",
        "method": "loadHistory",
        "id": "42",
        "params": [ "64e37db1fedadc25c854843d", { "$date": 1480377205 }, 50, { "$date": 1480377601 } ]
    }

    Example response

    The response consists of the message and unreadNotLoaded. The unreadNotLoaded counts the number of unread messages not loaded by the call.

    {
        "msg": "result",
        "id": "42",
        "result": {
            "messages": [
                {
                    "_id": "PbqaTCegrjT2aMY5B",
                    "rid": "64e37db1fedadc25c854843d",
                    "msg": "hi",
                    "ts": {
                        "$date": 1693045291715
                    },
                    "u": {
                        "_id": "4SebuZCHhQKvTt23o",
                        "username": "funke.olasupo",
                        "name": "Funke Olasupo"
                    },
                    "_updatedAt": {
                        "$date": 1693045291977
                    },
                    "urls": [],
                    "mentions": [],
                    "channels": [],
                    "md": [
                        {
                            "type": "PARAGRAPH",
                            "value": [
                                {
                                    "type": "PLAIN_TEXT",
                                    "value": "hi"
                                }
                            ]
                        }
                    ]
                },
                {
                    "_id": "Sj2genTaum82B4xRh",
                    "rid": "64e37db1fedadc25c854843d",
                    "msg": "hi",
                    "ts": {
                        "$date": 1692630610658
                    },
                    "u": {
                        "_id": "4SebuZCHhQKvTt23o",
                        "username": "funke.olasupo",
                        "name": "Funke Olasupo"
                    },
                    "_updatedAt": {
                        "$date": 1692630610822
                    },
                    "urls": [],
                    "mentions": [],
                    "channels": [],
                    "md": [
                        {
                            "type": "PARAGRAPH",
                            "value": [
                                {
                                    "type": "PLAIN_TEXT",
                                    "value": "hi"
                                }
                            ]
                        }
                    ]
                }
            ],
            "unreadNotLoaded": 0
        }
    }
    


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.
    ESC

    Eddy AI, facilitating knowledge discovery through conversational intelligence