forked from RocketChat/docs-old
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NEW] Added docs for addLeader and removeLeader endpoints in groups a…
…nd channels (RocketChat#1096) * add docs of channels.addLeader/removeLeader and groups.addLeader/removeLeader * update references of addLeader and removeLeader * fixed references * add version on groups.addLeader/removeLeader changelog and linked references in rest-api/README.md
- Loading branch information
1 parent
582947a
commit 61168cb
Showing
9 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | |