Forum Discussion
Navigate user to particular message in channel upon clicking a button in Personal Chat adaptive card
- Aug 30, 2022
AyeshaKulsumSJ -You can redirect User to particular channel using deep link.
You need to configure deep link URL with Adaptive Card button.Use this deep link format to navigate to a particular conversation within channel thread:
https://teams.microsoft.com/l/message/<channelId>/<parentMessageId>?tenantId=<tenantId>&groupId=<groupId>&parentMessageId=<parentMessageId>&teamName=<teamName>&channelName=<channelName>&createdTime=<createdTime>Example:
https://teams.microsoft.com/l/message/<channelId>/1648741500652?tenantId=<tenantId>&groupId=<groupId>&parentMessageId=1648741500652&teamName=<teamName>&channelName=<channelName>&createdTime=1648741500652Reference document-Create deep links - Teams | Microsoft Docs
Thanks,
Sayali
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
Are created time, teamName, and ChannelName mandatory as they can be changing? And already sent adaptive cards might not work. Can you help me with if there are any optional parameters here?
I had doubts if this is possible with message Id alone.
AyeshaKulsumSJ - You can try like below snippest.No need to change channel name and teams name everytime.
if (turnContext.Activity.Conversation.ConversationType == "channel")
{
channelID = turnContext.Activity.Conversation.Id.Split(';')[0];
tabUrlTask1 = deeplinkHelper.GetDeepLinkToChannelTask(teamsUrl, _configuration["MicrosoftAppId"], _configuration["BaseURL"], channelID, _configuration["ChannelEntityId"], "bot1");
tabUrlTask2 = deeplinkHelper.GetDeepLinkToChannelTask(teamsUrl, _configuration["MicrosoftAppId"], _configuration["BaseURL"], channelID, _configuration["ChannelEntityId"], "bot2");
tabUrlTask3 = deeplinkHelper.GetDeepLinkToChannelTask(teamsUrl, _configuration["MicrosoftAppId"], _configuration["BaseURL"], channelID, _configuration["ChannelEntityId"], "bot3");
extendedDeepLink = deeplinkHelper.GetDeepLinkToChannelTask(teamsUrl, _configuration["MicrosoftAppId"], _configuration["BaseURL"], channelID, _configuration["ChannelEntityId"], "");
}
Here is sample related to deeplink.
Sample Link-OfficeDev/Microsoft-Teams-Samples: Welcome to the Microsoft Teams samples repository. Here you will find task-focused samples in C#, JavaScript and TypeScript to help you get started with the Microsoft Teams App! (github.com)
- AyeshaKulsumSJNov 21, 2022Brass Contributor
Navigate is redirecting to the above shown UI rather than the expected UI. Can you help with this?