The #
is a room alias, only !
denotes a room ID.
Room IDs are the main identifier for a room, while one or more aliases can also be assigned to it for discovery purposes.
Any server can assign aliases - and therefore also serve the room discovery, but only if the room admins allow them.
Using the Matrix HQ room as an example; #matrix:matrix.org
is the canonical alias for the room, mapping to !OGEhHVWSdvArJzumhm:matrix.org
.
If you want to join the room, you either need to know the ID and some information on which servers are currently part of the room, or you need to know a room alias - which can be used to query the server owning it in order to receive the information on the room and how to join it.
For example; (%23
is the HTTP entity for #, since # would otherwise be handled as a client part of the URL)
$ curl -q 'https://matrix.org/_matrix/client/v3/directory/room/%23matrix:matrix.org' | jq '.room_id, .servers[0,1]'
"!OGEhHVWSdvArJzumhm:matrix.org"
"matrix.org"
"artemislena.eu"