From f692f282ec52ae99bd7d13b0cd67de988afa5a23 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Fri, 6 Apr 2018 13:13:51 -0300 Subject: [PATCH] Add docs to REST chat.reportMessage endpoint --- _data/toc.yml | 1 + .../documentation/documentation-map/README.md | 1 + developer-guides/rest-api/README.md | 1 + developer-guides/rest-api/chat/README.md | 1 + .../rest-api/chat/reportmessage/README.md | 38 +++++++++++++++++++ 5 files changed, 42 insertions(+) create mode 100644 developer-guides/rest-api/chat/reportmessage/README.md diff --git a/_data/toc.yml b/_data/toc.yml index e63ad9025e..b292cd0c14 100644 --- a/_data/toc.yml +++ b/_data/toc.yml @@ -248,6 +248,7 @@ - pinMessage - postMessage - react + - reportMessage - search - starMessage - sendMessage diff --git a/contributing/documentation/documentation-map/README.md b/contributing/documentation/documentation-map/README.md index 3d8b15451b..43051f301b 100644 --- a/contributing/documentation/documentation-map/README.md +++ b/contributing/documentation/documentation-map/README.md @@ -289,6 +289,7 @@ Here you can also find what articles are incomplete and missing. - pinMessage - postMessage - react + - reportMessage - search - starMessage - sendMessage diff --git a/developer-guides/rest-api/README.md b/developer-guides/rest-api/README.md index 22c709c43c..58cf774fd4 100644 --- a/developer-guides/rest-api/README.md +++ b/developer-guides/rest-api/README.md @@ -120,6 +120,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and | `/api/v1/chat.pinMessage` | Pins a chat message to the message's channel. | [Link](chat/pinmessage/) | | `/api/v1/chat.postMessage` | Posts a new chat message. | [Link](chat/postmessage/) | | `/api/v1/chat.react` | Sets/unsets the user's reaction to an existing chat message. | [Link](chat/react/) | +| `/api/v1/chat.reportMessage` | Reports a message. | [Link](chat/reportmessage/) | | `/api/v1/chat.search` | Search for messages in a channel. | [Link](chat/search/) | | `/api/v1/chat.starMessage` | Stars a chat message for the authenticated user. | [Link](chat/starmessage/) | | `/api/v1/chat.sendMessage` | Send new chat message. | [Link](chat/sendmessage/) | diff --git a/developer-guides/rest-api/chat/README.md b/developer-guides/rest-api/chat/README.md index d15465aece..65c4e168ba 100644 --- a/developer-guides/rest-api/chat/README.md +++ b/developer-guides/rest-api/chat/README.md @@ -7,6 +7,7 @@ | `/api/v1/chat.pinMessage` | Pins a chat message to the message's channel. | [Link](pinmessage/) | | `/api/v1/chat.postMessage` | Posts a new chat message. | [Link](postmessage/) | | `/api/v1/chat.react` | Sets/unsets the user's reaction to an existing chat message. | [Link](react/) | +| `/api/v1/chat.reportMessage` | Reports a message. | [Link](reportmessage/) | | `/api/v1/chat.search` | Search for messages in a channel. | [Link](search/) | | `/api/v1/chat.starMessage` | Stars a chat message for the authenticated user. | [Link](starmessage/) | | `/api/v1/chat.sendMessage` | Send new chat message. | [Link](sendmessage/) | diff --git a/developer-guides/rest-api/chat/reportmessage/README.md b/developer-guides/rest-api/chat/reportmessage/README.md new file mode 100644 index 0000000000..9d6b48bf26 --- /dev/null +++ b/developer-guides/rest-api/chat/reportmessage/README.md @@ -0,0 +1,38 @@ +# Chat Report Message + +Reports a message. + +| URL | Requires Auth | HTTP Method | +| :--- | :--- | :--- | +| `/api/v1/chat.reportMessage` | `yes` | `POST` | + +## Payload + +| Argument | Example | Required | Description | +| :--- | :--- | :--- | :--- | +| `messageId` | `7aDSXtjMA3KPLxLjt` | Required | The message id to report. | +| `description` | `test` | Required | The description of report. | + +## Example Call + +```bash +curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \ + -H "X-User-Id: aobEdbYhXfu5hkeqG" \ + -H "Content-type:application/json" \ + http://localhost:3000/api/v1/chat.reportMessage \ + -d '{ "messageId": "7aDSXtjMA3KPLxLjt", "description": "test" }' +``` + +## Example Result + +```json +{ + "success": true +} +``` + +## Change Log + +| Version | Description | +| :--- | :--- | +| 0.64.0 | Added |