Links
Comment on page

Messages Others

Retrieves the messages from any direct message in the server. It supports the Pagination parameters, alongside the Query and Fields parameters.
For this method to work, the Enable Direct Message History Endpoint setting (from the admin panel: General > REST API > Enable Direct Message History Endpoint) must be set to true, and the user calling this method must have the view-room-administration permission.
URL
Requires Auth
HTTP Method
/api/v1/im.messages.others
yes
GET

Query Parameters

Argument
Example
Required
Description
roomId
ByehQjC44FwMeiLbX
Required
The direct message id

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/im.messages.others?roomId=ByehQjC44FwMeiLbX

Example Result

{
"messages": [
{
"_id": "AkzpHAvZpdnuchw2a",
"rid": "ByehQjC44FwMeiLbX",
"msg": "hi",
"ts": "2016-12-09T12:50:51.555Z",
"u": {
"_id": "y65tAmHs93aDChMWu",
"username": "testing"
},
"_updatedAt": "2016-12-09T12:50:51.562Z"
},
{
"_id": "vkLMxcctR4MuTxreF",
"t": "uj",
"rid": "ByehQjC44FwMeiLbX",
"ts": "2016-12-08T15:41:37.730Z",
"msg": "testing2",
"u": {
"_id": "bRtgdhzM6PD9F8pSx",
"username": "testing2"
},
"groupable": false,
"_updatedAt": "2016-12-08T16:03:25.235Z"
},
{
"_id": "bfRW658nEyEBg75rc",
"t": "uj",
"rid": "ByehQjC44FwMeiLbX",
"ts": "2016-12-07T15:47:49.099Z",
"msg": "testing",
"u": {
"_id": "nSYqWzZ4GsKTX4dyK",
"username": "testing1"
},
"groupable": false,
"_updatedAt": "2016-12-07T15:47:49.099Z"
},
{
"_id": "pbuFiGadhRZTKouhB",
"t": "uj",
"rid": "ByehQjC44FwMeiLbX",
"ts": "2016-12-06T17:57:38.635Z",
"msg": "testing",
"u": {
"_id": "y65tAmHs93aDChMWu",
"username": "testing"
},
"groupable": false,
"_updatedAt": "2016-12-06T17:57:38.635Z"
}
],
"success": true
}

Change Log

Version
Description
0.50.0
Added
Last modified 5mo ago
Deprecation for cloud services and apps is now extended to November 20, 2023. Rocket.Chat versions receive support for six months after release.