Nov 05 2019 01:29 AM
Hello Experts,
I have created SPFx WebPart and deployed it in SharePoint. I have enabled "Team" scope and this works fine along with team context when I add it in MS Teams manually.
Now, I am trying to create Tab programmatically using Graph API endpoints as below,
Body:
{
"displayName": "Opportunity Summary",
"canUpdateConfiguration":true,
"teamsApp@odata.bind" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('8f4b04a6-a79e-4677-b81c-dff4e34d9989')",
"configuration": {"entityId": "d500-452a-885d-b091d9151dbe",
"contentUrl": "https://xxxxx.sharepoint.com/sites/team0042/_layouts/15/TeamsLogon.aspx?SPFX=true&dest=/sites/team00...",
"websiteUrl": null,
"removeUrl": null
}
}
The tab is getting created successfully but unable to load WebPart in the tab. Below is a response when I hit this API call,
{
"id": "a75956d0-131c-44e3-a484-f59dd2b6ea7e",
"displayName": "SPFx Summary WebPart",
"webUrl": "https://teams.microsoft.com/l/entity/xxxxx-a79e-4677-b81c-dff4e34d9989/_djb2_msteams_prefix_70e2b7d4...",
"configuration": {
"entityId": "sharepointtab_45b23925-551a-4d81-a0b9-9d46297098c1",
"contentUrl": "https://xxxxx.sharepoint.com/sites/team0042/_layouts/15/TeamsLogon.aspx?SPFX=true&dest=/sites/team00...",
"removeUrl": "https://xxxxx.sharepoint.com/sites/team0042/_layouts/15/TeamsLogon.aspx?SPFX=true&dest=/sites/team00...",
"websiteUrl": null,
"dateAdded": "2019-11-04T07:08:09.086Z"
}
}
Please guide me to defined configuration parameters in the body of Create Tab Graph API endpoints for deployed custom SPFx Teams App.
Thanks,
Uday G
Nov 07 2019 10:34 PM
@UdayG , Thanks for reporting this issue, We are looking into it.
Jan 07 2020 06:13 AM
Jan 07 2020 08:43 AM - edited Jan 07 2020 08:46 AM
Not really a great solution, but we have found that if you do not pass in a configuration but only provide the displayName and binding property in the JSON body, the tab is created with a "Set up" button that the user then needs to click to finish provisioning the tab:
{
"displayName": "My Custom Tab",
"teamsApp@odata.bind" : "<a href="<a href="https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/xxxxx-yyyy-wwww-vvvv-1234567890" target="_blank">https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/xxxxx-yyyy-wwww-vvvv-1234567890</a>" target="_blank"><a href="https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/xxxxx-yyyy-wwww-vvvv-1234567890</a" target="_blank">https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/xxxxx-yyyy-wwww-vvvv-1234567890</a</a>>"
}
Then, this is shown in the tab:
Clicking "Set up tab" gives this prompt:
We also found that trying to add a tab to a team created with a Graph API call with a token with App Permissions would cause this to fail (show a broken icon rather than the Team icon) because the "General" folder was not created in the Team (until a user clicks the "Files" tab). Creating the team with an access token with "Delegated Permissions" worked because the channel folder was set up properly (see https://techcommunity.microsoft.com/t5/teams-developer/adding-a-team-using-microsoft-graph-api-app-v...).
We are also still looking for a way to setup the tab for the user in advance, but at least this gets it to work.
Mary