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 763
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 #589 from RocketChat/feature/settings-preferences-…
…rest-api [NEW] Adding docs for user settings/preferences endpoints
- Loading branch information
Showing
5 changed files
with
152 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# User Get Preferences | ||
|
||
| URL | Requires Auth | HTTP Method | | ||
| :--- | :--- | :--- | | ||
| `/api/v1/users.getPreferences` | `yes` | `GET` | | ||
|
||
## 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/users.getPreferences | ||
``` | ||
|
||
## Example Result | ||
|
||
```json | ||
{ | ||
"preferences": { | ||
"newRoomNotification": "door", | ||
"newMessageNotification": "chime", | ||
"muteFocusedConversations": true, | ||
"useEmojis": true, | ||
"convertAsciiEmoji": true, | ||
"saveMobileBandwidth": true, | ||
"collapseMediaByDefault": false, | ||
"autoImageLoad": true, | ||
"emailNotificationMode": "all", | ||
"roomsListExhibitionMode": "category", | ||
"unreadAlert": true, | ||
"notificationsSoundVolume": 100, | ||
"desktopNotifications": "default", | ||
"mobileNotifications": "default", | ||
"enableAutoAway": true, | ||
"highlights": [], | ||
"desktopNotificationDuration": 0, | ||
"viewMode": 0, | ||
"hideUsernames": false, | ||
"hideRoles": false, | ||
"hideAvatars": false, | ||
"hideFlexTab": false, | ||
"sendOnEnter": "normal", | ||
"roomCounterSidebar": false | ||
}, | ||
"success": true | ||
} | ||
``` |
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,85 @@ | ||
# User Set Preferences | ||
|
||
| URL | Requires Auth | HTTP Method | | ||
| :--- | :--- | :--- | | ||
| `/api/v1/users.setPreferences` | `yes` | `POST` | | ||
|
||
## Payload | ||
|
||
| Argument | Example | Required | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| `userId` | `BsNr28znDkG8aeo7W` | Required | The id of the user. | | ||
| `data.newRoomNotification` | `test` | Required | New room notification. | | ||
| `data.newMessageNotification` | `test` | Required | New message notification. | | ||
| `data.useEmojis` | `true` | Required | User can use emojis. | | ||
| `data.convertAsciiEmoji` | `true` | Required | Convert ascII emojis. | | ||
| `data.saveMobileBandwidth` | `true` | Required | Save mobile bandwith. | | ||
| `data.collapseMediaByDefault` | `true` | Required | Collapse media by default. | | ||
| `data.autoImageLoad` | `true` | Required | Image load automatically. | | ||
| `data.emailNotificationMode` | `test` | Required | Email notification mode. | | ||
| `data.roomsListExhibitionMode` | `test` | Required | Rooms list exhibition mode. | | ||
| `data.unreadAlert` | `true` | Required | Unread Alert. | | ||
| `data.notificationsSoundVolume` | `100` | Required | Volume of notification sound. | | ||
| `data.desktopNotifications` | `test` | Required | Desktop notifications. | | ||
| `data.mobileNotifications` | `test` | Required | Mobile notifications. | | ||
| `data.enableAutoAway` | `true` | Required | Enable auto away. | | ||
| `data.highlights` | `[]` | Required | Highlights. | | ||
| `data.desktopNotificationDuration`| `100` | Required | Duration of desktop notification.| | ||
| `data.viewMode` | `0` | Required | View mode. | | ||
| `data.hideUsernames` | `false` | Required | Hide usernames. | | ||
| `data.hideRoles` | `false` | Required | Hide user roles. | | ||
| `data.hideAvatars` | `false` | Required | Hide avatars. | | ||
| `data.sendOnEnter` | `test` | Required | Send message on enter. | | ||
| `data.roomCounterSidebar` | `true` | Required | Display room counter on sidebar. | | ||
| `data.language` | `pt-BR` | Required | Language. | | ||
| `data.sidebarShowFavorites` | `true` | Optional | Show favorites on sidebar. | | ||
| `data.sidebarShowUnread` | `true` | Optional | Show unread on sidebar. | | ||
| `data.sidebarSortby` | `test` | Optional | Show sort by. | | ||
| `data.sidebarViewMode` | `test` | Optional | Show view mode. | | ||
| `data.sidebarHideAvatar` | `true` | Optional | Show avatar on hide bar. | | ||
| `data.mergeChannels` | `true` | Optional | Merge channels. | | ||
| `data.muteFocusedConversations` | `true` | Optional | Mute focused conversations. | | ||
|
||
## 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/users.setPreferences \ | ||
-d '{ "userId": "BsNr28znDkG8aeo7W", "data": { } }' | ||
``` | ||
|
||
## Example Result | ||
|
||
```json | ||
{ | ||
"success": true, | ||
"preferences": { | ||
"newRoomNotification": "door", | ||
"newMessageNotification": "chime", | ||
"muteFocusedConversations": true, | ||
"useEmojis": true, | ||
"convertAsciiEmoji": true, | ||
"saveMobileBandwidth": true, | ||
"collapseMediaByDefault": false, | ||
"autoImageLoad": true, | ||
"emailNotificationMode": "all", | ||
"roomsListExhibitionMode": "category", | ||
"unreadAlert": true, | ||
"notificationsSoundVolume": 100, | ||
"desktopNotifications": "default", | ||
"mobileNotifications": "default", | ||
"enableAutoAway": true, | ||
"highlights": [], | ||
"desktopNotificationDuration": 0, | ||
"viewMode": 0, | ||
"hideUsernames": false, | ||
"hideRoles": false, | ||
"hideAvatars": false, | ||
"hideFlexTab": false, | ||
"sendOnEnter": "normal", | ||
"roomCounterSidebar": false | ||
} | ||
} | ||
``` |