'How to share content via deep link in a Teams app?

I am developing a small Teams app also using the Teams-SDK. I am currently looking for a way to share contents from within my app in Teams (either via a chat or teams).

I found two ways:

However, both ways do not work as needed. The first method won't work from within a Teams app but only on websites. I also copied the used url from the method and tried to use it by using the "deeplink" function of the SDK but no luck. The second method does not fit my needs, because the button should create a draft with a curated text but no user pre-selected.



Solution 1:[1]

Are you planning to present/show the content in Tab for users. if yes, you can have buttons on that tab & on click on button on content, it will open a Task Module with prefilled data & you can implement search functionality/dropdown list to show list of recipient/teams. You can share the content with URL's to selected recipient/teams in channel or 1:1 chat. Doc links: https://docs.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman