Divyashree S B
Divyashree S B

Reputation: 43

Microsoft Teams Graph API : Add Tab to teams channel API failing in V1.0 but working in Beta for built in tab types

Below is the request for adding web tab.

1)API ->

POST - https://graph.microsoft.com/v1.0/teams/{teamID}/channels/{channelID}/tabs

2)Body ->

{
    "name":"[TabName]",
    "teamsAppId":"com.microsoft.teamspace.tab.web",
    "configuration":
    {
        "contentUrl":"[WebURL]",
        "websiteUrl":"[WebURL]"
    }
}

3)Error->

 "code": "InvalidRequest",
          "message": "The navigation bind for the teamsApp was missing in 
               request."

Tabs API is said to be GA already hence I'm posting this question.

GA Announcement link :

https://developer.microsoft.com/en-us/microsoft-teams/blogs/better-organize-and-automate-the-microsoft-teams-experience-with-the-availability-of-the-microsoft-graph-apis/

Please help me resolve this issue.

Upvotes: 2

Views: 3396

Answers (2)

Divyashree S B
Divyashree S B

Reputation: 43

Please find the solution below.

As mentioned by Nick in the above answer V1.0 has teamsApp property which can be used to set tab types. In case of built in tab types ,set "[email protected]" property to "https://graph.microsoft.com/beta/appCatalogs/teamsApps/[Built In tab Id]"

Example Website tab, https://graph.microsoft.com/beta/appCatalogs/teamsApps/com.microsoft.teamspace.tab.web

Refernce: https://learn.microsoft.com/en-us/graph/teams-configuring-builtin-tabs, https://developer.microsoft.com/en-us/graph/blogs/30daysmsgraph-day-27-use-case-create-a-team/

Upvotes: 2

Nick Kramer - MSFT
Nick Kramer - MSFT

Reputation: 136

It's not a great error message. The root cause is that there's no teamsAppId property in v1 -- instead there's a teamsApp property. (Which is also there in beta, btw) See https://learn.microsoft.com/en-us/graph/api/teamstab-add?view=graph-rest-1.0 for details.

Upvotes: 0

Related Questions