diff --git a/developer-guides/rest-api/README.md b/developer-guides/rest-api/README.md index f1e632ecec..ffe4f58d0e 100644 --- a/developer-guides/rest-api/README.md +++ b/developer-guides/rest-api/README.md @@ -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 diff --git a/developer-guides/rest-api/custom-user-status/README.md b/developer-guides/rest-api/custom-user-status/README.md index df87a1d574..f44776cca7 100644 --- a/developer-guides/rest-api/custom-user-status/README.md +++ b/developer-guides/rest-api/custom-user-status/README.md @@ -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/) | \ No newline at end of file +| 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/) | \ No newline at end of file diff --git a/developer-guides/rest-api/custom-user-status/create/README.md b/developer-guides/rest-api/custom-user-status/create/README.md new file mode 100644 index 0000000000..ff90c8acc5 --- /dev/null +++ b/developer-guides/rest-api/custom-user-status/create/README.md @@ -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 | diff --git a/developer-guides/rest-api/custom-user-status/delete/README.md b/developer-guides/rest-api/custom-user-status/delete/README.md new file mode 100644 index 0000000000..3a78e3ec28 --- /dev/null +++ b/developer-guides/rest-api/custom-user-status/delete/README.md @@ -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 | diff --git a/developer-guides/rest-api/custom-user-status/update/README.md b/developer-guides/rest-api/custom-user-status/update/README.md new file mode 100644 index 0000000000..bfbc8268c6 --- /dev/null +++ b/developer-guides/rest-api/custom-user-status/update/README.md @@ -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 |