diff --git a/_data/toc.yml b/_data/toc.yml index a89c182b4e..e0f8817bf6 100644 --- a/_data/toc.yml +++ b/_data/toc.yml @@ -244,6 +244,7 @@ - twitter - Channels: - addAll + - AddLeader - addModerator - addOwner - archive @@ -267,6 +268,7 @@ - moderators - online - open + - removeLeader - removeModerator - removeOwner - rename @@ -303,6 +305,7 @@ - get - Groups: - addAll + - addLeader - addModerator - addOwner - archive @@ -323,6 +326,7 @@ - messages - moderators - open + - removeLeader - removeModerator - removeOwner - rename diff --git a/contributing/documentation/documentation-map/README.md b/contributing/documentation/documentation-map/README.md index 292af771e3..078bb28e3a 100644 --- a/contributing/documentation/documentation-map/README.md +++ b/contributing/documentation/documentation-map/README.md @@ -258,6 +258,7 @@ Here you can also find what articles are incomplete and missing. - twitter - Channels: - addAll + - addLeader - addModerator - addOwner - archive @@ -281,6 +282,7 @@ Here you can also find what articles are incomplete and missing. - messages - online - open + - removeLeader - removeModerator - removeOwner - rename @@ -317,6 +319,7 @@ Here you can also find what articles are incomplete and missing. - get - Groups: - addAll + - addLeader - addModerator - addOwner - archive @@ -337,6 +340,7 @@ Here you can also find what articles are incomplete and missing. - messages - moderators - open + - removeLeader - removeModerator - removeOwner - rename diff --git a/developer-guides/rest-api/README.md b/developer-guides/rest-api/README.md index 609210b766..e27cce1e75 100644 --- a/developer-guides/rest-api/README.md +++ b/developer-guides/rest-api/README.md @@ -77,6 +77,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and | Url | Short Description | Details Page | | :-------------------------------------------- | :---------------------------------------------------------- | :---------------------------------------------- | | `/api/v1/channels.addAll` | Adds all of the users on the server to a channel. | [Link](channels/addall/) | +| `/api/v1/channels.addLeader` | Gives the role of Leader for a user in the current channel. | [Link](channels/addleader/) | | `/api/v1/channels.archive` | Archives a channel. | [Link](channels/archive/) | | `/api/v1/channels.cleanHistory` | Cleans up a channel's history, requires special permission. | [Link](channels/cleanhistory/) | | `/api/v1/channels.close` | Removes a channel from a user's list of channels. | [Link](channels/close/) | @@ -99,6 +100,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and | `/api/v1/channels.moderators` | List all moderators of a channel. | [Link](channels/moderators/) | | `/api/v1/channels.online` | List all online users of a channel. | [Link](channels/online/) | | `/api/v1/channels.open` | Adds the channel back to the user's list of channels. | [Link](channels/open/) | +| `/api/v1/channels.removeleader` | Removes the role of Leader for a user in the current channel. | [Link](channels/removeleader/) | | `/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/) | | `/api/v1/channels.setCustomFields` | Sets a channel's custom fields. | [Link](channels/setcustomfields/) | @@ -117,6 +119,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and | Url | Short Description | Details Page | | :------------------------------- | :------------------------------------------------- | :----------------------------- | | `/api/v1/groups.archive` | Archives a private group. | [Link](groups/archive/) | +| `/api/v1/groups.addLeader` | Gives the role of Leader for a user in the current group. | [Link](groups/addleader/) | | `/api/v1/groups.close` | Removes a private group from the list of groups. | [Link](groups/close/) | | `/api/v1/groups.counters` | Gets group counters. | [Link](groups/counters/) | | `/api/v1/groups.create` | Creates a new private group. | [Link](groups/create/) | @@ -133,6 +136,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and | `/api/v1/groups.messages` | Retrieves all group messages. | [Link](groups/messages/) | | `/api/v1/groups.moderators` | List all moderators of a group. | [Link](groups/moderators/) | | `/api/v1/groups.open` | Adds the private group back to the list of groups. | [Link](groups/open/) | +| `/api/v1/groups.removeLeader` | Removes the role of Leader for a user in the current group. | [Link](groups/removeleader/) | | `/api/v1/groups.rename` | Changes the name of the private group. | [Link](groups/rename/) | | `/api/v1/groups.roles` | Gets the user's roles in the private group. | [Link](groups/roles/) | | `/api/v1/groups.setAnnouncement` | Sets a group's announcement. | [Link](groups/setannouncement/)| diff --git a/developer-guides/rest-api/channels/README.md b/developer-guides/rest-api/channels/README.md index 00054ea9e6..08e493773e 100644 --- a/developer-guides/rest-api/channels/README.md +++ b/developer-guides/rest-api/channels/README.md @@ -5,6 +5,7 @@ These methods apply to public channels only. Use `groups.*` methods for private | Url | Short Description | Details Page | | :--- | :--- | :--- | | `/api/v1/channels.addAll` | Adds all of the users on the server to a channel. | [Link](addall/) | +| `/api/v1/channels.addLeader` | Gives the role of Leader for a user in the current channel. | [Link](addleader/) | | `/api/v1/channels.addModerator` | Gives the role of moderator to a user in a channel. | [Link](addmoderator/) | | `/api/v1/channels.addOwner` | Gives the role of owner to a user in a channel. | [Link](addowner/) | | `/api/v1/channels.archive` | Archives a channel. | [Link](archive/) | @@ -28,6 +29,7 @@ These methods apply to public channels only. Use `groups.*` methods for private | `/api/v1/channels.moderators` | List all moderators of a channel. | [Link](moderators/) | | `/api/v1/channels.online` | List all online users of a channel. | [Link](online/) | | `/api/v1/channels.open` | Adds the channel back to the user's list of channels. | [Link](open/) | +| `/api/v1/channels.removeleader` | Removes the role of Leader for a user in the current channel. | [Link](removeleader/) | | `/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/) | | `/api/v1/channels.rename` | Changes a channel's name. | [Link](rename/) | diff --git a/developer-guides/rest-api/channels/addleader/README.md b/developer-guides/rest-api/channels/addleader/README.md new file mode 100644 index 0000000000..e50bad4f7a --- /dev/null +++ b/developer-guides/rest-api/channels/addleader/README.md @@ -0,0 +1,50 @@ +# Channel Add Leader + +Gives the role of Leader for a user in the current channel. + +| URL | Requires Auth | HTTP Method | +| :--- | :--- | :--- | +| `/api/v1/channels.addLeader` | `yes` | `POST` | + +## Payload + +| Argument | Example | Required | Description | +| :--- | :--- | :--- | :--- | +| `roomId` | `ByehQjC44FwMeiLbX` | Required | The channel's id | +| `userId` | `oCHkav5Zf6vmpu2W2` | Required | The user's id | + +## 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/channels.addLeader \ + -d '{"roomId": "ByehQjC44FwMeiLbX", "userId": "oCHkav5Zf6vmpu2W2"}' +``` + +## Success Example Result + +```json +{ + "success": true +} +``` + +## Bad Request Example Result + +If the user is already a leader, will return a `400 bad request` status. + +```json +{ + "success": false, + "error": "User is already a leader [error-user-already-leader]", + "errorType": "error-user-already-leader" +} +``` + +## Change Log + +| Version | Description | +| :--- | :--- | +| 0.75.0 | Added. | diff --git a/developer-guides/rest-api/channels/removeleader/README.md b/developer-guides/rest-api/channels/removeleader/README.md new file mode 100644 index 0000000000..ddc9c08ad8 --- /dev/null +++ b/developer-guides/rest-api/channels/removeleader/README.md @@ -0,0 +1,50 @@ +# Channel Remove Leader + +Removes the role of Leader for a user in the current channel. + +| URL | Requires Auth | HTTP Method | +| :--- | :--- | :--- | +| `/api/v1/channels.removeLeader` | `yes` | `POST` | + +## Payload + +| Argument | Example | Required | Description | +| :--- | :--- | :--- | :--- | +| `roomId` | `ByehQjC44FwMeiLbX` | Required | The channel's id | +| `userId` | `oCHkav5Zf6vmpu2W2` | Required | The user's id | + +## 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/channels.removeLeader \ + -d '{"roomId": "ByehQjC44FwMeiLbX", "userId": "oCHkav5Zf6vmpu2W2"}' +``` + +## Success Example Result + +```json +{ + "success": true +} +``` + +## Bad Request Example Result + +If the user is not a leader, will return a `400 bad request` status. + +```json +{ + "success": false, + "error": "User is not a leader [error-user-not-leader]", + "errorType": "error-user-not-leader" +} +``` + +## Change Log + +| Version | Description | +| :--- | :--- | +| 0.75.0 | Added. | diff --git a/developer-guides/rest-api/groups/README.md b/developer-guides/rest-api/groups/README.md index 4bee1464e3..2d66103a31 100644 --- a/developer-guides/rest-api/groups/README.md +++ b/developer-guides/rest-api/groups/README.md @@ -3,6 +3,7 @@ | Url | Short Description | Details Page | | :--- | :--- | :--- | | `/api/v1/groups.addAll` | Adds all of the users on the server to a private group. | [Link](addall/) | +| `/api/v1/groups.addLeader` | Gives the role of Leader for a user in the current group. | [Link](addleader/) | | `/api/v1/groups.addModerator` | Gives the role of moderator to a user in a group. | [Link](addmoderator/) | | `/api/v1/groups.addOwner` | Gives the role of owner to a user in a group. | [Link](addowner/) | | `/api/v1/groups.archive` | Archives a private group. | [Link](archive/) | @@ -23,6 +24,7 @@ | `/api/v1/groups.members` | Gets the users of participants of a private group. | [Link](members/) | | `/api/v1/groups.messages` | Retrieves all group messages. | [Link](messages/) | | `/api/v1/groups.open` | Adds the private group back to the list of groups. | [Link](open/) | +| `/api/v1/groups.removeLeader` | Removes the role of Leader for a user in the current group. | [Link](removeleader/) | | `/api/v1/groups.removeModerator` | Removes the role of moderator from a user in a group. | [Link](removemoderator/) | | `/api/v1/groups.removeOwner` | Removes the role of owner from a user in a group. | [Link](removeowner/) | | `/api/v1/groups.rename` | Changes the name of the private group. | [Link](rename/) | diff --git a/developer-guides/rest-api/groups/addleader/README.md b/developer-guides/rest-api/groups/addleader/README.md new file mode 100644 index 0000000000..43ff490bea --- /dev/null +++ b/developer-guides/rest-api/groups/addleader/README.md @@ -0,0 +1,50 @@ +# Group Add Leader + +Gives the role of Leader for a user in the current group. + +| URL | Requires Auth | HTTP Method | +| :--- | :--- | :--- | +| `/api/v1/groups.addLeader` | `yes` | `POST` | + +## Payload + +| Argument | Example | Required | Description | +| :--- | :--- | :--- | :--- | +| `roomId` | `ByehQjC44FwMeiLbX` | Required | The groups's id | +| `userId` | `oCHkav5Zf6vmpu2W2` | Required | The user's id | + +## 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/groups.addLeader \ + -d '{"roomId": "ByehQjC44FwMeiLbX", "userId": "oCHkav5Zf6vmpu2W2"}' +``` + +## Success Example Result + +```json +{ + "success": true +} +``` + +## Bad Request Example Result + +If the user is already a leader, will return a `400 bad request` status. + +```json +{ + "success": false, + "error": "User is already a leader [error-user-already-leader]", + "errorType": "error-user-already-leader" +} +``` + +## Change Log + +| Version | Description | +| :--- | :--- | +| 0.58.0 | Added. | diff --git a/developer-guides/rest-api/groups/removeleader/README.md b/developer-guides/rest-api/groups/removeleader/README.md new file mode 100644 index 0000000000..65426167f0 --- /dev/null +++ b/developer-guides/rest-api/groups/removeleader/README.md @@ -0,0 +1,50 @@ +# Group Remove Leader + +Removes the role of Leader for a user in the current group. + +| URL | Requires Auth | HTTP Method | +| :--- | :--- | :--- | +| `/api/v1/groups.removeLeader` | `yes` | `POST` | + +## Payload + +| Argument | Example | Required | Description | +| :--- | :--- | :--- | :--- | +| `roomId` | `ByehQjC44FwMeiLbX` | Required | The groups's id | +| `userId` | `oCHkav5Zf6vmpu2W2` | Required | The user's id | + +## 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/groups.removeLeader \ + -d '{"roomId": "ByehQjC44FwMeiLbX", "userId": "oCHkav5Zf6vmpu2W2"}' +``` + +## Success Example Result + +```json +{ + "success": true +} +``` + +## Bad Request Example Result + +If the user is not a leader, will return a `400 bad request` status. + +```json +{ + "success": false, + "error": "User is not a leader [error-user-not-leader]", + "errorType": "error-user-not-leader" +} +``` + +## Change Log + +| Version | Description | +| :--- | :--- | +| 0.58.0 | Added. |