diff --git a/_data/toc.yml b/_data/toc.yml index 59db04c50f..c242388b31 100644 --- a/_data/toc.yml +++ b/_data/toc.yml @@ -245,6 +245,7 @@ - rename - roles - setCustomFields + - setDefault - setDescription - setJoinCode - setPurpose diff --git a/contributing/documentation/documentation-map/README.md b/contributing/documentation/documentation-map/README.md index 1d8191c8a8..9cffcf0fe6 100644 --- a/contributing/documentation/documentation-map/README.md +++ b/contributing/documentation/documentation-map/README.md @@ -281,6 +281,7 @@ Here you can also find what articles are incomplete and missing. - rename - roles - setCustomFields + - setDefault - setDescription - setJoinCode - setPurpose diff --git a/developer-guides/rest-api/README.md b/developer-guides/rest-api/README.md index b1e58b8ca3..f0f6f2a408 100644 --- a/developer-guides/rest-api/README.md +++ b/developer-guides/rest-api/README.md @@ -84,6 +84,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and | `/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/) | | `/api/v1/channels.setAnnouncement` | Sets a channel's announcement. | [Link](channels/setannouncement/) | +| `/api/v1/channels.setDefault` | Sets whether a channel is a default channel or not. | [Link](channels/setdefault/) | | `/api/v1/channels.setDescription` | Sets a channel's description. | [Link](channels/setdescription/) | | `/api/v1/channels.setJoinCode` | Sets the channel's code required to join it. | [Link](channels/setjoincode/) | | `/api/v1/channels.setPurpose` | Sets a channel's description. | [Link](channels/setpurpose/) | diff --git a/developer-guides/rest-api/channels/README.md b/developer-guides/rest-api/channels/README.md index 3cac255dda..9385ea9dbc 100644 --- a/developer-guides/rest-api/channels/README.md +++ b/developer-guides/rest-api/channels/README.md @@ -26,6 +26,7 @@ | `/api/v1/channels.rename` | Changes a channel's name. | [Link](rename/) | | `/api/v1/channels.roles` | Gets the user's roles in the channel.| [Link](roles/) | | `/api/v1/channels.setCustomFields` | Sets a channel's custom fields. | [Link](setcustomfields/) | +| `/api/v1/channels.setDefault` | Sets a channel's default status. | [Link](setdefault/) | | `/api/v1/channels.setDescription` | Sets a channel's description. | [Link](setdescription/) | | `/api/v1/channels.setJoinCode` | Sets the channel's code required to join it. | [Link](setjoincode/) | | `/api/v1/channels.setPurpose` | Sets a channel's description. | [Link](setpurpose/) | diff --git a/developer-guides/rest-api/channels/setdefault/README.md b/developer-guides/rest-api/channels/setdefault/README.md new file mode 100644 index 0000000000..de90424be7 --- /dev/null +++ b/developer-guides/rest-api/channels/setdefault/README.md @@ -0,0 +1,59 @@ +# Channel Set Default + +Sets whether the channel is a default channel or not. + +| URL | Requires Auth | HTTP Method | +| :--- | :--- | :--- | +| `/api/v1/channels.setDefault` | `yes` | `POST` | + +## Payload + +| Argument | Example | Required | Description | +| :--- | :--- | :--- | :--- | +| `roomId` | `ByehQjC44FwMeiLbX` | Required | The channel's id | +| `default` | `true` | Required | Boolean of whether the room is default or not. | + +## 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.setDefault \ + -d '{ "roomId": "ByehQjC44FwMeiLbX", "default": true }' +``` + +## Example Result + +```json +{ + "channel": { + "_id": "ByehQjC44FwMeiLbX", + "name": "testing0", + "t": "c", + "msgs": 0, + "u": { + "_id": "aiPqNoGkjpNDiRx6d", + "username": "goose160" + }, + "ts": "2017-01-05T18:02:50.754Z", + "ro": true, + "sysMes": true, + "_updatedAt": "2017-01-05T19:02:24.429Z", + "usernames": [ + "goose160", + "graywolf336" + ], + "joinCodeRequired": true, + "muted": [], + "default": true + }, + "success": true +} +``` + +## Change Log + +| Version | Description | +| :--- | :--- | +| 0.66.0 | Added |