Sync Messages

It supports the Pagination parameters.

URLRequires AuthHTTP Method

/api/v1/chat.syncMessages

yes

GET

Headers

ArgumentExampleRequiredDescription

X-User-Id

myuser-name

Required

Your username hash (returned after you log in through the API)

X-Auth-Token

myauth-token

Required

Your token (returned after you log in through the API)

Query Parameters

ArgumentExampleRequiredDescription

roomId

5qW6ssMFyzWjJev69

Required

Room ID

lastUpdate

2019-04-16T18:30:46.669Z

Required

Date as ISO string

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     http://localhost:3000/api/v1/chat.syncMessages?roomId=5qW6ssMFyzWjJev69&lastUpdate=2019-04-16T18:30:46.669Z

Example Result

{
    "result": {
        "updated": [
            {
                "_id": "ak3WdaLbf4P7ZW3wQ",
                "rid": "5qW6ssMFyzWjJev69",
                "u": {
                    "_id": "FWfHnJmcudrCagGDX",
                    "username": "555192857993",
                    "name": "555192857993"
                },
                "msg": "teste",
                "ts": "2021-09-24T19:19:47.911Z",
                "_updatedAt": "2021-09-24T19:19:48.048Z",
                "alias": "mauricio pretto",
                "token": "do554ryecscmfrrxyxpvm",
                "unread": true,
                "urls": [],
                "mentions": [],
                "channels": [],
                "md": [
                    {
                        "type": "PARAGRAPH",
                        "value": [
                            {
                                "type": "PLAIN_TEXT",
                                "value": "teste"
                            }
                        ]
                    }
                ]
            },
            {
                "_id": "2ttrNPABcCKbsbEtB",
                "t": "livechat-started",
                "msg": "",
                "groupable": false,
                "ts": "2021-09-24T19:19:46.523Z",
                "u": {
                    "_id": "FWfHnJmcudrCagGDX",
                    "username": "555192857993",
                    "name": "555192857993"
                },
                "rid": "5qW6ssMFyzWjJev69",
                "unread": true,
                "_updatedAt": "2021-09-24T19:19:46.691Z",
                "urls": [],
                "mentions": [],
                "channels": []
            }
        ],
        "deleted": []
    },
    "success": true
}

Change Log

VersionDescription

1.0.0

Added

Last updated

Rocket.Chat versions receive support for six months after release.