Forum Discussion

oskarkuus's avatar
oskarkuus
Brass Contributor
Feb 12, 2024

Custome app in left navigation - deeplink to different sharepoint pages?

Hi

 

I have this custome app (manifest)

 

{
	"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
	"version": "1.0.0",
	"manifestVersion": "1.16",
	"id": "8bf7ccfe-406b-4129-a504-f406901ae8c5",
	"packageName": "com.package.name",
	"name": {
		"short": "Heaven",
		"full": "Heaven"
	},
	"developer": {
		"name": "MyCompany",
		"mpnId": "",
		"websiteUrl": "https://www.mycompany.com",
		"privacyUrl": "https://www.mycompany.com",
		"termsOfUseUrl": "https://www.mycompany.com"
	},
	"description": {
		"short": "Heaven",
		"full": "Heaven"
	},
	"icons": {
		"outline": "outline.png",
		"color": "color.png"
	},
	"accentColor": "#ffffff",
	"staticTabs": [
		{
			"entityId": "091a285d-5536-42b5-94c8-94a4060efb79",
			"name": "Heaven",
			"contentUrl": "https://mycompany.sharepoint.com/sites/Intranat",
			"websiteUrl": "https://mycompany.sharepoint.com/sites/Intranat",
			"scopes": [
				"personal"
			],
			"context": [
				"personalTab"
			]
		},
		{
			"entityId": "about",
			"scopes": [
				"personal"
			]
		}
	],
	"validDomains": [
		"mycompany.sharepoint.com"
	],
	"isFullScreen": true,
	"defaultGroupCapability": {}
}

 

The app works. If i install it and open it, it points to and opens https://mycompany.sharepoint.com/sites/Intranat

 

That is great!!

 

But now i want to deeplink on that specific sharepoint site (https://mycompany.sharepoint.com/sites/Intranat) to a specific page like this for example: https://mycompany.sharepoint.com/sites/Intranat/SitePages/MyPage.aspx

 

After reading the documentation i figured out it should be like this:

https://teams.microsoft.com/l/entity/8bf7ccfe-406b-4129-a504-f406901ae8c5/091a285d-5536-42b5-94c8-94a4060efb79/webUrl=https%3A%2F%2Fmycompany.sharepoint.com%2Fsites%2FIntranat%2FSitePages%2FMyPage.aspx

 

This URL opens the app and the correct tab in the app. But it does not go to the specified webUrl.

How do i make the deeplink to the specific page in sharepoint?

 

 

 

6 Replies

  • LeonPavesic's avatar
    LeonPavesic
    Silver Contributor

    Hi oskarkuus,

    To generate a deep link to a specific SharePoint page in your custom Microsoft Teams app, follow these steps:

    1. Obtain the URL of the SharePoint page you want to link to, for example: https://mycompany.sharepoint.com/sites/Intranat/SitePages/MyPage.aspx.

    2. URI encode the SharePoint URL, replacing any special characters with their encoded values. You can use online tools for this encoding.

    3. Construct the deep link for your Teams app. The format is https://teams.microsoft.com/l/entity/<AppId>/<EntityID>. Replace <AppId> with your app's ID and <EntityID> with the ID of the tab within your app.

      For example: https://teams.microsoft.com/l/entity/8bf7ccfe-406b-4129-a504-f406901ae8c5/091a285d-5536-42b5-94c8-94a4060efb79

    4. Append the encoded SharePoint URL as a query parameter named webUrl to the deep link. Ensure the query parameter is properly formatted.

      For example: https://teams.microsoft.com/l/entity/8bf7ccfe-406b-4129-a504-f406901ae8c5/091a285d-5536-42b5-94c8-94a4060efb79?webUrl=https%3A%2F%2Fmycompany.sharepoint.com%2Fsites%2FIntranat%2FSitePages%2FMyPage.aspx

    This composed URL should open your app in Microsoft Teams and navigate directly to the specified SharePoint page.



    Please click Mark as Best Response & Like if my post helped you to solve your issue.
    This will help others to find the correct solution easily. It also closes the item.


    If the post was useful in other ways, please consider giving it Like.


    Kindest regards,


    Leon Pavesic
    (LinkedIn)
    (Twitter)

    • oskarkuus's avatar
      oskarkuus
      Brass Contributor

      LeonPavesic 

      Thank you.

       

      But that is how i think i just wrote how i have done

      https://teams.microsoft.com/l/entity/8bf7ccfe-406b-4129-a504-f406901ae8c5/091a285d-5536-42b5-94c8-94a4060efb79?webUrl=https%3A%2F%2Fmycompany.sharepoint.com%2Fsites%2FIntranat%2FSitePages%2FMyPage.aspx

       

      This URL is :

      https://teams.microsoft.com/l/entity/<appID>/<entityId>?webUrl=https%3A%2F%2Fmycompany.sharepoint.com%2Fsites%2FIntranat%2FSitePages%2FMyPage.aspx

       

      And according to your guide i think this should be correct?

       

      What am i doing wrong?

       

      • LeonPavesic's avatar
        LeonPavesic
        Silver Contributor

        Hi oskarkuus,

        it seems you've already tried the correct approach but I would still recommend to check:

        SharePoint Page Access:

        • Verify that users have the necessary permissions to access the specific SharePoint page you're linking to. Insufficient permissions could prevent the deep link from working as expected.

         



        Please click Mark as Best Response & Like if my post helped you to solve your issue.
        This will help others to find the correct solution easily. It also closes the item.


        If the post was useful in other ways, please consider giving it Like.


        Kindest regards,


        Leon Pavesic
        (LinkedIn)
        (Twitter)