RocketChat / Rocket.Chat

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

Delete livechat Room via Realtime API #17256

Closed Requium closed 4 years ago

Requium commented 4 years ago

I was wondering if there is a way to delete closed Livechats Rooms via the API, i already tested the use of : ddpclient.call("eraseRoom",[roomid])

But its saying not allowed as error, and i'm logged with an admin role, i made some test with normal rooms and it deletes it, but i guess livechat rooms are treated as another type of object in the database (maybe?), so maybe it requires another type of access?, i read the livechat Rooms API documentation and i only see a close call to close the livechat room, btw i can delete the rooms via manual procedure.

Thanks in advancement BR.

renatobecker commented 4 years ago

Hi @Requium

The Omnichannel/Livechat has its own method to remove rooms, you just need to call livechat:removeRoom, as you can see here:

https://github.com/RocketChat/Rocket.Chat/blob/develop/app/livechat/server/methods/removeRoom.js#L8

Requium commented 4 years ago

Thanks!!..