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

Added api guides for custom user status #1605

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions developer-guides/rest-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,12 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and

### Custom User Status

| Url | Short Description | Details Page |
| :-------------------------------- | :--------------------------------------------- | :----------------------------- |
| `/api/v1/custom-user-status.list` | Lists all available custom user's status. | [Link](custom-user-status/list/) |
| Url | Short Description | Details Page |
| :---------------------------------- | :--------------------------------------------- | :----------------------------- |
| `/api/v1/custom-user-status.list` | Lists all available custom user's status. | [Link](custom-user-status/list/) |
| `/api/v1/custom-user-status.create` | Create new custom custom user's status. | [Link](custom-user-status/create/) |
| `/api/v1/custom-user-status.delete` | Delete an existent custom custom user's status.| [Link](custom-user-status/delete/) |
| `/api/v1/custom-user-status.update` | Update an existent custom custom user's status.| [Link](custom-user-status/update/) |

### Emoji Custom

Expand Down
9 changes: 6 additions & 3 deletions developer-guides/rest-api/custom-user-status/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Custom User Status Endpoints

| Url | Short Description | Details Page |
| :-------------------------------- | :--------------------------------------------- | :----------------------------- |
| `/api/v1/custom-user-status.list` | Lists all available custom user's status. | [Link](list/) |
| Url | Short Description | Details Page |
| :---------------------------------- | :--------------------------------------------- | :----------------------------- |
| `/api/v1/custom-user-status.list` | Lists all available custom user's status. | [Link](list/) |
| `/api/v1/custom-user-status.create` | Create new custom custom user's status. | [Link](create/) |
| `/api/v1/custom-user-status.delete` | Delete an existent custom custom user's status. | [Link](delete/) |
| `/api/v1/custom-user-status.update` | Update an existent custom custom user's status. | [Link](update/) |
35 changes: 35 additions & 0 deletions developer-guides/rest-api/custom-user-status/create/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Custom User Status Create

Create new custom user status.

| URL | Requires Auth | HTTP Method |
| :-------------------------------- | :------------ | :---------- |
| `/api/v1/custom-user-status.create` | `yes` | `POST` |

## Example Call

```bash
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/custom-user-status.create
```

## Example Result

```json
{
"customUserStatus": {
"_id": "d3TjnQgKWttgaW9Hh",
"name": "status 2",
"statusType": "online",
"_updatedAt": "2019-12-09T20:25:10.884Z"
},
"success": true
}
```

## Change Log

| Version | Description |
| :------ | :---------- |
| 2.4.0 | Added |
35 changes: 35 additions & 0 deletions developer-guides/rest-api/custom-user-status/delete/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Custom User Status Delete

| URL | Requires Auth | HTTP Method |
| :-------------------------------- | :------------ | :---------- |
| `/api/v1/custom-user-status.delete` | `yes` | `POST` |

## Payload

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `customUserStatusId` | `ByehQjC44FwMeiLbX` | Required | The custom user status id to be deleted. |

## 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/custom-user-status.delete
-d '{ "customUserStatusId": "ByehQjC44FwMeiLbX" }'
```

## Example Result

```json
{
"success": true
}
```

## Change Log

| Version | Description |
| :------ | :---------- |
| 2.4.0 | Added |
47 changes: 47 additions & 0 deletions developer-guides/rest-api/custom-user-status/update/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Custom User Status List

Update an existent custom user status.

| URL | Requires Auth | HTTP Method |
| :-------------------------------- | :------------ | :---------- |
| `/api/v1/custom-user-status.update` | `yes` | `POST` |


### Arguments

| Argument | Example | Required | Description |
| :--------- | :---------------- | :------- | :---------- |
| `_id` | `AG7DSB2H32YHS` | Required | The id of the custom user status. |
| `name` | `my-custom-status` | Required | The name of the custom user status. |
| `statusType` | `online` | Optional | The status of the custom user status. |

## Example Call

```bash
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
-F "_id=AG7DSB2H32YHS" \
-F "name=my-custom-status" \
-F "statusType=online" \
http://localhost:3000/api/v1/custom-user-status.update
```

## Example Result

```json
{
"customUserStatus": {
"_id": "oGxJ2irQcPkgFLGef",
"name": "status 1",
"statusType": "busy",
"_updatedAt": "2019-12-09T20:26:06.477Z"
},
"success": true
}
```

## Change Log

| Version | Description |
| :------ | :---------- |
| 2.4.0 | Added |