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
Add channels.setCustomFields and groups.setCustomFields. Fix purpose. #600
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7e9d216
Add channels.setCustomFields and groups.setCustomFields. Fix purpose.
xbolshe 6b14544
Restore setPurpose description
xbolshe eb4ad0f
Obsolescence notification is added
xbolshe 8733b64
Update Schema Definition: add customFields
xbolshe 1b3ab6e
Merge branch 'master' into pr2
MartinSchoeler a8a3a53
Merge branch 'master' into pr2
MartinSchoeler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let this be as it was before, the api is called set purpose due compatibility reasons, it does really change the description of the channel (as shown in the ui)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Restored with an obsolescence notification.