Get Message

Retrieves a single chat message for the message ID. You must have permission to access the room where the message is.

URLRequires AuthHTTP Method

/api/v1/chat.getMessage

yes

GET

Path Variables

ArgumentExampleRequiredDescription

msgId

7aDSXtjMA3KPLxLjt

Required

The ID of the message to get.

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     -H "Content-type:application/json" \
     http://localhost:3000/api/v1/chat.getMessage?msgId=7aDSXtjMA3KPLxLjt

Example Result

{
  "message": {
    "_id": "7aDSXtjMA3KPLxLjt",
    "rid": "GENERAL",
    "msg": "This is a test!",
    "ts": "2016-12-14T20:56:05.117Z",
    "u": {
      "_id": "y65tAmHs93aDChMWu",
      "username": "graywolf336"
    }
  },
  "success": true
}

Change Log

VersionDescription

0.47.0

Added

Last updated

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