diff --git a/_data/toc.yml b/_data/toc.yml index a25d62e1e6..07d5fdf87c 100644 --- a/_data/toc.yml +++ b/_data/toc.yml @@ -250,6 +250,7 @@ - list.joined - list - members + - moderators - open - removeModerator - removeOwner @@ -301,6 +302,7 @@ - leave - list - listAll + - moderators - members - open - removeModerator diff --git a/contributing/documentation/documentation-map/README.md b/contributing/documentation/documentation-map/README.md index 6e59217ea9..ff36261603 100644 --- a/contributing/documentation/documentation-map/README.md +++ b/contributing/documentation/documentation-map/README.md @@ -277,6 +277,7 @@ Here you can also find what articles are incomplete and missing. - list.joined - list - members + - moderators - open - removeModerator - removeOwner @@ -328,6 +329,7 @@ Here you can also find what articles are incomplete and missing. - leave - list - listAll + - moderators - members - open - removeModerator diff --git a/developer-guides/rest-api/README.md b/developer-guides/rest-api/README.md index 05b4f28740..0dd35c26fc 100644 --- a/developer-guides/rest-api/README.md +++ b/developer-guides/rest-api/README.md @@ -93,6 +93,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and | `/api/v1/channels.list` | Retrieves all of the channels from the server. | [Link](channels/list/) | | `/api/v1/channels.list.joined` | Gets only the channels the calling user has joined. | [Link](channels/list-joined/) | | `/api/v1/channels.members` | Retrieves all channel users. | [Link](channels/members/) | +| `/api/v1/channels.moderators` | List all moderators of a channel. | [Link](channels/moderators/) | | `/api/v1/channels.open` | Adds the channel back to the user's list of channels. | [Link](channels/open/) | | `/api/v1/channels.rename` | Changes a channel's name. | [Link](channels/rename/) | | `/api/v1/channels.roles` | Gets the user's roles in the channel. | [Link](channels/roles/) | @@ -124,6 +125,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and | `/api/v1/groups.leave` | Removes the calling user from the private group. | [Link](groups/leave/) | | `/api/v1/groups.list` | List the private groups the caller is part of. | [Link](groups/list/) | | `/api/v1/groups.listAll` | List all the private groups. | [Link](groups/listall/) | +| `/api/v1/groups.moderators` | List all moderators of a group. | [Link](groups/moderators/) | | `/api/v1/groups.members` | Gets the users of participants of a private group. | [Link](groups/members/) | | `/api/v1/groups.open` | Adds the private group back to the list of groups. | [Link](groups/open/) | | `/api/v1/groups.rename` | Changes the name of the private group. | [Link](groups/rename/) | diff --git a/developer-guides/rest-api/channels/README.md b/developer-guides/rest-api/channels/README.md index 85ca597683..c3478f9cb5 100644 --- a/developer-guides/rest-api/channels/README.md +++ b/developer-guides/rest-api/channels/README.md @@ -23,6 +23,7 @@ These methods apply to public channels only. Use `groups.*` methods for private | `/api/v1/channels.list` | Retrieves all of the channels from the server. | [Link](list/) | | `/api/v1/channels.list.joined` | Gets only the channels the calling user has joined. | [Link](list-joined/) | | `/api/v1/channels.members` | Retrieves all channel users. | [Link](members/) | +| `/api/v1/channels.moderators` | List all moderators of a channel. | [Link](moderators/) | | `/api/v1/channels.open` | Adds the channel back to the user's list of channels. | [Link](open/) | | `/api/v1/channels.removeModerator` | Removes the role of moderator from a user in a channel. | [Link](removemoderator/) | | `/api/v1/channels.removeOwner` | Removes the role of owner from a user in a channel. | [Link](removeowner/) | diff --git a/developer-guides/rest-api/channels/moderators/README.md b/developer-guides/rest-api/channels/moderators/README.md new file mode 100644 index 0000000000..60f713c815 --- /dev/null +++ b/developer-guides/rest-api/channels/moderators/README.md @@ -0,0 +1,43 @@ +# Channel Moderators List + +Lists all channel moderators. + +| URL | Requires Auth | HTTP Method | +| :--- | :--- | :--- | +| `/api/v1/channels.moderators` | `yes` | `GET` | + +## Query Parameters + +| Argument | Example | Required | Description | +| :--------- | :------------------ | :------------------------ | :----------------- | +| `roomId` | `ByehQjC44FwMeiLbX` | Required (if no roomName) | The channel's id | +| `roomName` | `general` | Required (if no roomId) | The channel's name | + +## Example Call + +```bash +curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \ + -H "X-User-Id: aobEdbYhXfu5hkeqG" \ + http://localhost:3000/api/v1/channels.moderators?roomId=ByehQjC44FwMeiLbX +``` + +## Example Result + +```json +{ + "moderators": [ + { + "_id": "rocket.cat", + "username": "rocket.cat", + "name": Rocket.Cat + } + ], + "success": true +} +``` + +## Change Log + +| Version | Description | +| :--- | :--- | +| 0.70.0 | Added | diff --git a/developer-guides/rest-api/groups/README.md b/developer-guides/rest-api/groups/README.md index 95a6c3c312..c95164e23a 100644 --- a/developer-guides/rest-api/groups/README.md +++ b/developer-guides/rest-api/groups/README.md @@ -19,6 +19,7 @@ | `/api/v1/groups.leave` | Removes the calling user from the private group. | [Link](leave/) | | `/api/v1/groups.list` | List the private groups the caller is part of. | [Link](list/) | | `/api/v1/groups.listAll` | List all the private groups. | [Link](listall/) | +| `/api/v1/groups.moderators` | List all moderators of a group. | [Link](moderators/) | | `/api/v1/groups.members` | Gets the users of participants of a private group. | [Link](members/) | | `/api/v1/groups.open` | Adds the private group back to the list of groups. | [Link](open/) | | `/api/v1/groups.removeModerator` | Removes the role of moderator from a user in a group. | [Link](removemoderator/) | diff --git a/developer-guides/rest-api/groups/moderators/README.md b/developer-guides/rest-api/groups/moderators/README.md new file mode 100644 index 0000000000..050039a7c3 --- /dev/null +++ b/developer-guides/rest-api/groups/moderators/README.md @@ -0,0 +1,43 @@ +# Group Moderators List + +Lists all group moderators. + +| URL | Requires Auth | HTTP Method | +| :--- | :--- | :--- | +| `/api/v1/groups.moderators` | `yes` | `GET` | + +## Query Parameters + +| Argument | Example | Required | Description | +| :--------- | :------------------ | :------------------------ | :----------------- | +| `roomId` | `ByehQjC44FwMeiLbX` | Required (if no roomName) | The group's id | +| `roomName` | `general` | Required (if no roomId) | The group's name | + +## Example Call + +```bash +curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \ + -H "X-User-Id: aobEdbYhXfu5hkeqG" \ + http://localhost:3000/api/v1/groups.moderators?roomId=ByehQjC44FwMeiLbX +``` + +## Example Result + +```json +{ + "moderators": [ + { + "_id": "rocket.cat", + "username": "rocket.cat", + "name": Rocket.Cat + } + ], + "success": true +} +``` + +## Change Log + +| Version | Description | +| :--- | :--- | +| 0.70.0 | Added |