The Great Open Source Debate with Elastic, Gluu and GitHub 🎤 Oct 26

Does the rest api with query param roomName handle names with spaces correctly?


I’ve enabled the setting that allows special chars in room names and am successfully able to create room names with spaces in them.

I would now like to hit the endpoint using the query param roomName.

However, this is the url that’s generated:


and the response that’s received:

    "success": false,
    "error": "The required \"roomId\" or \"roomName\" param provided does not match any group [error-room-not-found]",
    "errorType": "error-room-not-found"

So I’m guessing that I’m going to have to use the roomId to get the room information or is there still a way to query using the roomName of a room that has spaces in its name?

As it turns out, I had a look in the mongo collection called rocketchat_rooms and saw that there are two name fields. One is called fname and the other is called name.

fname seems to be the actual name whereas name is normalized so the spaces were swapped with hyphens so when I queried using the name instead of the fname (which is what I was using initially) like the following


then it worked!

1 Like


Thanks for sharing the solution!