Skip to content

Commit

Permalink
Add docs to REST delete channels and groups (RocketChat#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto authored and MartinSchoeler committed Sep 5, 2018
1 parent cf6949d commit bd2755e
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 10 deletions.
2 changes: 2 additions & 0 deletions _data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
- close
- counters
- create
- delete
- files
- getAllUserMentionsByChannel
- getIntegrations
Expand Down Expand Up @@ -290,6 +291,7 @@
- close
- counters
- create
- delete
- files
- getIntegrations
- history
Expand Down
4 changes: 2 additions & 2 deletions contributing/documentation/documentation-map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ Here you can also find what articles are incomplete and missing.
- close
- counters
- create
- <span class="missing">[delete](../missing-and-outdated-list/index.html#channelsdelete)</span>
- delete
- files
- getAllUserMentionsByChannel
- getIntegrations
Expand Down Expand Up @@ -318,7 +318,7 @@ Here you can also find what articles are incomplete and missing.
- close
- counters
- create
- <span class="missing">[delete](../missing-and-outdated-list/index.html#groupsdelete)</span>
- delete
- files
- getIntegrations
- history
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,6 @@ Create a guide on how to use Rocket.Chat as an Oauth provider.

Create documentation on how to use oauth2 o365 authentication service with Rocket.Chat. You can find info on this issue <https://github.com/RocketChat/Rocket.Chat/issues/6809>

## channels.delete

Create documentation on how the `channels.delete` REST API endpoint works

## groups.delete

Create documentation on how the `groups.delete` REST API endpoint works

## Custom Fields

Create documentation on how to add custom fields to Rocket.Chat and how they work.
2 changes: 2 additions & 0 deletions developer-guides/rest-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and
| `/api/v1/channels.close` | Removes a channel from a user's list of channels. | [Link](channels/close/) |
| `/api/v1/channels.counters` | Gets channel counters. | [Link](channels/counters/) |
| `/api/v1/channels.create` | Creates a new channel. | [Link](channels/create/) |
| `/api/v1/channels.delete` | Removes a channel. | [Link](channels/delete/) |
| `/api/v1/channels.files` | Gets a list of files from a channel. | [Link](channels/files/) |
| `/api/v1/channels.getAllUserMentionsByChannel`| Gets all the mentions of a channel. | [Link](channels/getallusermentionsbychannel/) |
| `/api/v1/channels.getIntegrations` | Gets the channel's integration. | [Link](channels/getintegrations/) |
Expand Down Expand Up @@ -113,6 +114,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and
| `/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/) |
| `/api/v1/groups.delete` | Removes a private group. | [Link](groups/delete/) |
| `/api/v1/groups.files` | Gets a list of files from a private group. | [Link](groups/files/) |
| `/api/v1/groups.history` | Retrieves the messages from a private group. | [Link](groups/history/) |
| `/api/v1/groups.info` | Gets the information about a private group. | [Link](groups/info/) |
Expand Down
1 change: 1 addition & 0 deletions developer-guides/rest-api/channels/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ These methods apply to public channels only. Use `groups.*` methods for private
| `/api/v1/channels.close` | Removes a channel from a user's list of channels. | [Link](close/) |
| `/api/v1/channels.counters` | Gets channel counters. | [Link](counters/) |
| `/api/v1/channels.create` | Creates a new channel. | [Link](create/) |
| `/api/v1/channels.delete` | Removes a channel. | [Link](delete/) |
| `/api/v1/channels.getAllUserMentionsByChannel`| Gets all the mentions of a channel. | [Link](getallusermentionsbychannel/) |
| `/api/v1/channels.files` | Gets a list of files from a channel. | [Link](files/) |
| `/api/v1/channels.getIntegrations` | Gets the channel's integration. | [Link](getintegrations/)
Expand Down
52 changes: 52 additions & 0 deletions developer-guides/rest-api/channels/delete/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Channel Delete

Remove a public channel.

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `/api/v1/channels.delete` | `yes` | `POST` |

## Payload

| 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" \
-H "Content-type: application/json" \
http://localhost:3000/api/v1/channels.delete \
-d '{ "roomName": "channelname" }'
```

## Example Result

```json
{
"channel": {
"_id": "ByehQjC44FwMeiLbX",
"name": "channelname",
"t": "c",
"usernames": [
"example"
],
"msgs": 0,
"u": {
"_id": "aobEdbYhXfu5hkeqG",
"username": "example"
},
"ts": "2016-05-30T13:42:25.304Z"
},
"success": true
}
```

## Change Log

| Version | Description |
| :--- | :--- |
| 0.49.0 | Added |
1 change: 1 addition & 0 deletions developer-guides/rest-api/groups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
| `/api/v1/groups.close` | Removes a private group from the list of groups. | [Link](close/) |
| `/api/v1/groups.counters` | Gets group counters. | [Link](counters/) |
| `/api/v1/groups.create` | Creates a new private group. | [Link](create/) |
| `/api/v1/groups.delete` | Removes a private group. | [Link](delete/)|
| `/api/v1/groups.files` | Gets a list of files from a private group. | [Link](files/) |
| `/api/v1/groups.getIntegrations` | Gets the integrations assigned to the group. | [Link](getintegrations/) |
| `/api/v1/groups.history` | Retrieves the messages from a private group. | [Link](history/) |
Expand Down
52 changes: 52 additions & 0 deletions developer-guides/rest-api/groups/delete/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Group Delete

Remove a private channel.

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `/api/v1/groups.delete` | `yes` | `POST` |

## Payload

| 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" \
-H "Content-type: application/json" \
http://localhost:3000/api/v1/groups.delete \
-d '{ "roomName": "channelname" }'
```

## Example Result

```json
{
"group": {
"_id": "ByehQjC44FwMeiLbX",
"name": "groupname",
"t": "c",
"usernames": [
"example"
],
"msgs": 0,
"u": {
"_id": "aobEdbYhXfu5hkeqG",
"username": "example"
},
"ts": "2016-05-30T13:42:25.304Z"
},
"success": true
}
```

## Change Log

| Version | Description |
| :--- | :--- |
| 0.49.0 | Added |

0 comments on commit bd2755e

Please sign in to comment.