This repository has been archived by the owner on Mar 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #600 from xbolshe/pr2
Add channels.setCustomFields and groups.setCustomFields. Fix purpose.
- Loading branch information
Showing
10 changed files
with
182 additions
and
35 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
55 changes: 55 additions & 0 deletions
55
developer-guides/rest-api/channels/setcustomfields/README.md
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,55 @@ | ||
# Channel Set Custom Fields | ||
|
||
Sets the custom fields for the channel. | ||
|
||
| URL | Requires Auth | HTTP Method | | ||
| :--- | :--- | :--- | | ||
| `/api/v1/channels.setCustomFields` | `yes` | `POST` | | ||
|
||
## Payload | ||
|
||
One of roomId or roomName is required. | ||
|
||
| Argument | Example | Required | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| `roomId` | `GENERAL` | Required | The channel's id | | ||
| `roomName` | `general` | Required | The channel's name | | ||
| `customFields` | `{"organization": "tra-la-la"}` | Required | The custom fields to set for the channel. | | ||
|
||
## Example Call | ||
|
||
```bash | ||
curl -H "X-Auth-Token: 8h2mKAwxB3AQrFSjLVKMooJyjdCFaA7W45sWlHP8IzO" \ | ||
-H "X-User-Id: ew28FnZqipDpvKw3R" \ | ||
-H "Content-type: application/json" \ | ||
http://localhost:3000/api/v1/channels.setCustomFields \ | ||
-d '{"roomId": "GENERAL", "customFields":{"organization": "tra-la-la"} }' | ||
``` | ||
|
||
## Example Result | ||
|
||
```json | ||
{ | ||
"channel":{ | ||
"_id":"GENERAL", | ||
"ts":"2018-02-18T19:41:02.875Z", | ||
"t":"c", | ||
"name":"general", | ||
"msgs":236, | ||
"default":true, | ||
"_updatedAt":"2018-02-23T11:09:05.973Z", | ||
"lm":"2018-02-18T22:18:20.288Z", | ||
"customFields":{ | ||
"organization":"tra-la-la" | ||
} | ||
}, | ||
"success":true, | ||
"developerWarning":"[WARNING]: The \"usernames\" field has been removed for performance reasons. Please use the \"*.members\" endpoint to get a list of members/users in a room." | ||
} | ||
``` | ||
|
||
## Change Log | ||
|
||
| Version | Description | | ||
| :--- | :--- | | ||
| 0.62.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
61 changes: 61 additions & 0 deletions
61
developer-guides/rest-api/groups/setcustomfields/README.md
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,61 @@ | ||
# Group Set Custom Fields | ||
|
||
Sets the custom fields for the private group. | ||
|
||
| URL | Requires Auth | HTTP Method | | ||
| :--- | :--- | :--- | | ||
| `/api/v1/groups.setCustomFields` | `yes` | `POST` | | ||
|
||
## Payload | ||
|
||
One of roomId or roomName is required. | ||
|
||
| Argument | Example | Required | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| `roomId` | `euzoT67Gx6nXcn66M` | Required | The private group's id | | ||
| `roomName` | `channel.cf.1518990680083` | Required | The private group's name | | ||
| `customFields` | `{"company": "sell-and-more"}` | Required | The custom fields to set for the private group. | | ||
|
||
## Example Call | ||
|
||
```bash | ||
curl -H "X-Auth-Token: 8h2mKAwxB3AQrFSjLVKMooJyjdCFaA7W45sWlHP8IzO" \ | ||
-H "X-User-Id: ew28FnZqipDpvKw3R" \ | ||
-H "Content-type: application/json" \ | ||
http://localhost:3000/api/v1/groups.setCustomFields \ | ||
-d '{"roomId": "euzoT67Gx6nXcn66M", "customFields":{"company": "sell-and-more"} }' | ||
``` | ||
|
||
## Example Result | ||
|
||
```json | ||
{ | ||
"group":{ | ||
"_id":"euzoT67Gx6nXcn66M", | ||
"name":"channel.cf.1518990680083", | ||
"fname":"channel.cf.1518990680083", | ||
"t":"p", | ||
"msgs":0, | ||
"u":{ | ||
"_id":"ew28FnZqipDpvKw3R", | ||
"username":"rocketchat.internal.admin.test" | ||
}, | ||
"customFields":{ | ||
"company":"sell-and-more" | ||
}, | ||
"ts":"2018-02-18T21:51:20.091Z", | ||
"ro":false, | ||
"sysMes":true, | ||
"_updatedAt":"2018-02-23T11:27:01.411Z", | ||
"username":"rocketchat.internal.admin.test" | ||
}, | ||
"success":true, | ||
"developerWarning":"[WARNING]: The \"usernames\" field has been removed for performance reasons. Please use the \"*.members\" endpoint to get a list of members/users in a room." | ||
} | ||
``` | ||
|
||
## Change Log | ||
|
||
| Version | Description | | ||
| :--- | :--- | | ||
| 0.62.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