Get a deep link to a channel


#1

As I see if I want to open a Mattermost page in the browser with specified channel selected I have to use /<team_name>/channels/<channel_name>. On the other hand from the websocket event I have only a channel_id information.

So, the question is, what’s the most simple way to create such a link using the API? Also for direct message channels which do not specify team_id.


#2

Hi @alec,

You can also visit a channel by navigating to /<team name>/channels/<channel ID>.

For DM channels, there’s not really a good way to go to that channel without the team name. If you’re doing this from the browser, you might be able to parse out the current team name. If that’s not possible, you could just get all of the user’s teams and pick one. We do something similar to link to the post in email notifications, but we try to identify a team that both users are on first before just picking a random team.