Get push notification

Get push notification for a message

Requires the can-access-room permission.

URLRequires AuthHTTP Method

/api/v1/push.get

yes

GET

Query Parameters

ArgumentExampleRequiredDescription

id

WkbwSntxt8D3jLp8G

Required

The message id.

Example Call

curl -L -X GET 'http://localhost:3000/api/v1/push.get?id=WkbwSntxt8D3jLp8G' \
-H 'X-User-Id: d26x6zSkaPSe5gCyy' \
-H 'X-Auth-Token: Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92'

Example Result

Success

{
    "data": {
        "message": {
            "_id": "WkbwSntxt8D3jLp8G",
            "rid": "iu7jtPAhvEeAS5tNq",
            "msg": "fsfs",
            "ts": "2021-10-22T14:29:23.581Z",
            "u": {
                "_id": "d26x6zSkaPSe5gCyy",
                "username": "rodriq",
                "name": "Rodriq"
            },
            "urls": [],
            "mentions": [],
            "channels": [],
            "md": [
                {
                    "type": "PARAGRAPH",
                    "value": [
                        {
                            "type": "PLAIN_TEXT",
                            "value": "fsfs"
                        }
                    ]
                }
            ],
            "_updatedAt": "2021-10-22T14:29:23.603Z"
        },
        "notification": {
            "from": "push",
            "badge": 2,
            "sound": "default",
            "priority": 10,
            "title": "#vb",
            "text": "rodriq: fsfs",
            "payload": {
                "host": "http://localhost:3000/",
                "messageId": "WkbwSntxt8D3jLp8G",
                "notificationType": "message",
                "rid": "iu7jtPAhvEeAS5tNq",
                "sender": {
                    "_id": "d26x6zSkaPSe5gCyy",
                    "username": "rodriq",
                    "name": "Rodriq"
                },
                "senderName": "rodriq",
                "type": "c",
                "name": "vb"
            },
            "userId": "d26x6zSkaPSe5gCyy",
            "notId": 654494840,
            "gcm": {
                "style": "inbox",
                "image": "http://localhost:3000/images/logo/android-chrome-192x192.png"
            },
            "apn": {
                "category": "MESSAGE"
            }
        }
    },
    "success": true
}

Error

Any of the following errors can occur on the endpoint.

  • Authorization: Requires an authentication token for the request to be made.

  • Message not Found: Seen when the room id passed in does not exist.

  • Not Allowed: Occurs when the user doesn't have access to the room.

  • Room not Found: Occurs when the room containing the message is not found.

{
    "status": "error",
    "message": "You must be logged in to do this."
}

Change Log

VersionDescription

3.5.0

Added

Last updated

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