RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.56k stars 10.58k forks source link

[BUG] REST API endpoint /users does not conform to best practices #23899

Open ear-dev opened 2 years ago

ear-dev commented 2 years ago

Description:

Currently all actions on "users" with the REST API use unique endpoints.... ex. users.create, users.delete, users.get_avatar, etc.... where the userID is contained in the body. This does not conform to best practices because a GET on the endpoint /users itself should return a collection of users, and the path to perform actions on a specific user should include the "_id"....... ex. /users/{_id} with a GET, DELETE, PUT etc...

A good example of best practice is in the /livechat/departments endpoint, and it would be best if all REST API endpoints used the same design.

We are using terraform to configure users, omnichannel departments, omnichannel agents, etc.... and the users endpoint as is, is not compatible with terraforms 'destroy resource' strategy, and therefore it breaks our automation.

Skeen commented 2 years ago

@ear-dev What Terraform provider are you using?

ear-dev commented 2 years ago

restapi = { source = "fmontezuma/restapi" version = "1.14.1" }