Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Hi Prashant Singh,
Thank you for posting your question in the Microsoft Q&A forum.
After researching your scenario, I found that what you are trying to achieve is not currently supported by Microsoft. There is no officially documented mechanism (whether through URL scheme, Microsoft Graph API, or any SDK) that allows passing content into the Viva Engage composer upon opening.
The reason this differs from the "Share to Teams" experience you referenced is that "Share to Teams" is a purpose-built feature developed by Microsoft specifically for sharing content from external web apps into Teams. It comes with its own JavaScript SDK and dedicated URL endpoints designed to accept content parameters. In contrast, Viva Engage deep links were designed solely for navigation purposes like directing users to existing entities such as threads, communities, storylines, and campaigns. They do not accept any parameters related to message composition or content prefilling.
That said, there are two possible workarounds you could consider:
Workaround 1: Deep Link combined with Clipboard API
You can programmatically copy the desired content to the user's clipboard using the navigator.clipboard.writeText()API, and then open Viva Engage via a deep link (e.g., https://engage.cloud.microsoft/main/groups/<GroupId> or the Teams deep link format). The user would then need to manually paste the content into the composer. The advantage of this approach is that it requires no API permissions or server-side authentication and is straightforward to implement. The downside is that the user experience is suboptimal, as it relies on the user to manually paste the content, and some browsers may restrict clipboard access without a direct user gesture.
Note: This information is provided as a convenience to you. These sites are not controlled by Microsoft, and Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please ensure that you fully understand the risks before using any suggestions from the above link.
Workaround 2: Post directly via the Yammer REST API
You can bypass the composer entirely and post the message directly to Viva Engage using the legacy Yammer REST API endpoint POST https://www.yammer.com/api/v1/messages.json. This allows you to specify the message body, target group, and other parameters programmatically. To mitigate the risk of users not being able to review content before posting, you can implement a preview/confirmation modal within your own web application before making the API call. However, there are important caveats: this approach requires OAuth or Microsoft Entra authentication, and more critically, the legacy Yammer REST APIs using Yammer OAuth2 tokens are set to retire on June 30, 2025. After that date, you must authenticate via Microsoft Entra applications. Additionally, the Microsoft Graph API for Viva Engage does not yet offer an equivalent endpoint for creating posts.
References:
I would also recommend submitting a feature request through the Microsoft Feedback Portal for a "Share to Viva Engage" SDK similar to what exists for Teams, as this appears to be a genuine gap in the platform's capabilities.
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.