diff --git a/_data/toc.yml b/_data/toc.yml index 3f232df893..141e3f810c 100644 --- a/_data/toc.yml +++ b/_data/toc.yml @@ -316,6 +316,7 @@ - getMessage - getMessageReadReceipts - getPinnedMessages + - getSnippetedMessages - getSnippetedMessageById - getStarredMessages - getThreadMessages diff --git a/contributing/documentation/documentation-map/README.md b/contributing/documentation/documentation-map/README.md index 3a5dd83ac3..ecd4c0baad 100644 --- a/contributing/documentation/documentation-map/README.md +++ b/contributing/documentation/documentation-map/README.md @@ -310,6 +310,7 @@ Here you can also find what articles are incomplete and missing. - getMessage - getMessageReadReceipts - getPinnedMessages + - getSnippetedMessages - getSnippetedMessageById - getStarredMessages - getThreadMessages diff --git a/developer-guides/rest-api/README.md b/developer-guides/rest-api/README.md index e122af1cf5..6adee9dee9 100644 --- a/developer-guides/rest-api/README.md +++ b/developer-guides/rest-api/README.md @@ -171,6 +171,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and | `/api/v1/chat.getMessage` | Retrieves a single chat message. | [Link](chat/getmessage/) | | `/api/v1/chat.getMessageReadReceipts` | Retrieves message read receipts. | [Link](chat/getmessagereadreceipts/) | | `/api/v1/chat.getPinnedMessages` | Retrieve pinned messages from a room. | [Link](chat/getpinnedmessages/) | +| `/api/v1/chat.getSnippetedMessages` | Retrieves snippeted messages. | [Link](chat/getsnippetedmessages/) | | `/api/v1/chat.getSnippetedMessageById`| Retrieves snippeted message by id. | [Link](chat/getsnippetedmessagebyid/) | | `/api/v1/chat.getStarredMessages` | Retrieves starred messages. | [Link](chat/getstarredmessages/) | | `/api/v1/chat.getThreadMessages` | Retrieves thread's messages. | [Link](chat/getthreadmessages/) | diff --git a/developer-guides/rest-api/chat/README.md b/developer-guides/rest-api/chat/README.md index 00ca49b034..d7929542dc 100644 --- a/developer-guides/rest-api/chat/README.md +++ b/developer-guides/rest-api/chat/README.md @@ -10,6 +10,7 @@ | `/api/v1/chat.getMessage` | Retrieves a single chat message. | [Link](getmessage/) | | `/api/v1/chat.getMessageReadReceipts` | Retrieves message read receipts. | [Link](getmessagereadreceipts/) | | `/api/v1/chat.getPinnedMessages` | Retrieve pinned messages from a room. | [Link](getpinnedmessages/) | +| `/api/v1/chat.getSnippetedMessages` | Retrieves snippeted messages. | [Link](getsnippetedmessages/) | | `/api/v1/chat.getSnippetedMessageById`| Retrieves snippeted message by id. | [Link](getsnippetedmessagebyid/) | | `/api/v1/chat.getStarredMessages` | Retrieves the starred messages. | [Link](getstarredmessages/) | | `/api/v1/chat.getThreadMessages`| Retrieves thread's messages. | [Link](getthreadmessages/) | diff --git a/developer-guides/rest-api/chat/getsnippetedmessages/README.md b/developer-guides/rest-api/chat/getsnippetedmessages/README.md new file mode 100644 index 0000000000..e17839a9f2 --- /dev/null +++ b/developer-guides/rest-api/chat/getsnippetedmessages/README.md @@ -0,0 +1,60 @@ +# Get Snippeted Messages + +Retrieve snippeted messages. It supports the [Offset, Count, and Sort Query Parameters](../../offset-and-count-and-sort-info/). + +| URL | Requires Auth | HTTP Method | +| :--- | :--- | :--- | +| `/api/v1/chat.getSnippetedMessages` | `yes` | `GET` | + +## Query Parameters + +| Argument | Example | Required | Description | +| :--- | :--- | :--- | :--- | +| `roomId` | `ByehQjC44FwMeiLbX` | Required | The room id | + +## Example Call + +```bash +curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \ + -H "X-User-Id: aobEdbYhXfu5hkeqG" \ + http://localhost:3000/api/v1/chat.getSnippetedMessages?roomId=ByehQjC44FwMeiLbX +``` + +## Example Result + +```json +{ + "messages": [ + { + "_id": "QQuPFFcLmsqHWeqhn", + "rid": "GENERAL", + "msg": "``````\ntest\n``````", + "ts": "2019-10-25T21:42:39.022Z", + "u": { + "_id": "CaevAPDbXN252kyXa", + "username": "marcos.defendi", + "name": "Marcos Defendi" + }, + "_updatedAt": "2019-10-25T22:54:02.094Z", + "mentions": [], + "channels": [], + "snippetName": "ee", + "snippeted": true, + "snippetedBy": { + "_id": "CaevAPDbXN252kyXa", + "username": "marcos.defendi" + } + } + ], + "count": 1, + "offset": 0, + "total": 1, + "success": true +} +``` + +## Change Log + +| Version | Description | +| :---- | :---- | +| 2.3.0 | Added |