Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #737 from RocketChat/feature/rest-username-suggestion
Browse files Browse the repository at this point in the history
[NEW] Add REST endpoint to get username suggestion
  • Loading branch information
engelgabriel authored May 30, 2018
2 parents ee1c178 + 742e9b8 commit 3da45b1
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 17 deletions.
1 change: 1 addition & 0 deletions _data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@
- getAvatar
- getPresence
- get-preferences
- getUsernameSuggestion
- info
- list
- register
Expand Down
1 change: 1 addition & 0 deletions contributing/documentation/documentation-map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ Here you can also find what articles are incomplete and missing.
- getAvatar
- getPresence
- getPreferences
- getUsernameSuggestion
- info
- list
- register
Expand Down
35 changes: 18 additions & 17 deletions developer-guides/rest-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,24 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and

### Users

| Url | Short Description | Details Page |
| :---------------------------------- | :-------------------------------------------------------------- | :---------------------------------- |
| `/api/v1/users.create` | Create a new user. | [Link](users/create/) |
| `/api/v1/users.createToken` | Create a user authentication token. | [Link](users/createtoken/) |
| `/api/v1/users.delete` | Deletes an existing user. | [Link](users/delete/) |
| `/api/v1/users.forgotPassword` | Send email to reset your password. | [Link](users/forgotpassword/) |
| `/api/v1/users.getAvatar` | Gets the URL for a user's avatar. | [Link](users/getavatar/) |
| `/api/v1/users.getPresence` | Gets the online presence of a user. | [Link](users/getpresence/) |
| `/api/v1/users.info` | Gets a user's information, limited to the caller's permissions. | [Link](users/info/) |
| `/api/v1/users.list` | All of the users and their information, limited to permissions. | [Link](users/list/) |
| `/api/v1/users.register` | Register a new user. | [Link](users/register/) |
| `/api/v1/users.resetAvatar` | Reset a user's avatar | [Link](users/resetavatar/) |
| `/api/v1/users.setAvatar` | Set a user's avatar | [Link](users/setavatar/) |
| `/api/v1/users.update` | Update an existing user. | [Link](users/update/) |
| `/api/v1/users.updateOwnBasicInfo` | Update basic information of own user. | [Link](users/updateownbasicinfo/) |
| `/api/v1/users.getPreferences` | Gets all preferences of user. | [Link](users/get-preferences/) |
| `/api/v1/users.setPreferences` | Set user's preferences | [Link](users/set-preferences/) |
| Url | Short Description | Details Page |
| :------------------------------------ | :-------------------------------------------------------------- | :----------------------------------- |
| `/api/v1/users.create` | Create a new user. | [Link](users/create/) |
| `/api/v1/users.createToken` | Create a user authentication token. | [Link](users/createtoken/) |
| `/api/v1/users.delete` | Deletes an existing user. | [Link](users/delete/) |
| `/api/v1/users.forgotPassword` | Send email to reset your password. | [Link](users/forgotpassword/) |
| `/api/v1/users.getAvatar` | Gets the URL for a user's avatar. | [Link](users/getavatar/) |
| `/api/v1/users.getPreferences` | Gets all preferences of user. | [Link](users/get-preferences/) |
| `/api/v1/users.getPresence` | Gets the online presence of a user. | [Link](users/getpresence/) |
| `/api/v1/users.getUsernameSuggestion` | Gets a suggestion a new username to user. | [Link](users/getusernamesuggestion/) |
| `/api/v1/users.info` | Gets a user's information, limited to the caller's permissions. | [Link](users/info/) |
| `/api/v1/users.list` | All of the users and their information, limited to permissions. | [Link](users/list/) |
| `/api/v1/users.register` | Register a new user. | [Link](users/register/) |
| `/api/v1/users.resetAvatar` | Reset a user's avatar | [Link](users/resetavatar/) |
| `/api/v1/users.setAvatar` | Set a user's avatar | [Link](users/setavatar/) |
| `/api/v1/users.setPreferences` | Set user's preferences | [Link](users/set-preferences/) |
| `/api/v1/users.update` | Update an existing user. | [Link](users/update/) |
| `/api/v1/users.updateOwnBasicInfo` | Update basic information of own user. | [Link](users/updateownbasicinfo/) |

### Channels

Expand Down
1 change: 1 addition & 0 deletions developer-guides/rest-api/users/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| `/api/v1/users.forgotPassword` | Send email to reset your password. | [Link](forgotpassword/) |
| `/api/v1/users.getAvatar` | Gets the URL for a user's avatar. | [Link](getavatar/) |
| `/api/v1/users.getPresence` | Gets the online presence of a user. | [Link](getpresence/) |
| `/api/v1/users.getUsernameSuggestion` | Gets a suggestion a new username to user. | [Link](getusernamesuggestion/) |
| `/api/v1/users.info` | Gets a user's information, limited to the caller's permissions. | [Link](info/) |
| `/api/v1/users.list` | All of the users and their information, limited to permissions. | [Link](list/) |
| `/api/v1/users.register` | Register a new user. | [Link](register/) |
Expand Down
30 changes: 30 additions & 0 deletions developer-guides/rest-api/users/getusernamesuggestion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# User Get Username Suggestion

Gets a suggestion a new username to user.

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `/api/v1/users.getUsernameSuggestion` | `yes` | `GET` |

## Other Users Example Call

```bash
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/users.getUsernameSuggestion
```

## Example Result

```json
{
"result": "rocket.cat",
"success": true
}
```

## Change Log

| Version | Description |
| :--- | :--- |
| 0.65.0 | Added |

0 comments on commit 3da45b1

Please sign in to comment.