Graph Api adding tab to MSTeams error: "needs to be in an unblocked state to install/update a tab"

Karen Adams 76 Reputation points
2021-01-05T23:00:00.327+00:00

I get this error on this graph api request (for adding a tab to a MSTeams team):
Request:
POST https://graph.microsoft.com/v1.0/teams/fe3b256f-6407-41fb-962c-4cef48e85b6d/channels/19:6418b36ec8a242a48d817b08c9362a50@thread.tacv2/tabs

{"displayName":"hello","teamsApp@odata.bind":"https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/a79c6959-0c6d-4353-a22c-682611b86c5f","configuration":{"entityId":"9c2fbbf5-bf26-4ef7-9401-abe8d03d2c17","contentUrl":"https://fast-snake-22.loca.lt/teams/tabs/dash","removeUrl":"https://fast-snake-22.loca.lt/teams/tabs/remove","websiteUrl":"https://fast-snake-22.loca.lt/personal/tab"}}

Response:
{
"error": {
"code": "BadRequest",
"message": "App id a79c6959-0c6d-4353-a22c-682611b86c5f needs to be installed to the team fe3b256f-6407-41fb-962c-4cef48e85b6d:19:6418b36ec8a242a48d817b08c9362a50@thread.tacv2 and be in an unblocked state to install/update a tab",
"innerError": {
"date": "2021-01-05T22:25:03",
"request-id": "487a5591-d81e-4abb-a3f3-65fb620d5d36",
"client-request-id": "62e00982-09cf-1811-c501-fb43f9f4c3de"
}
}
}

Question: I don't understand what it means to be in "unblocked state." My app is installed on the team so that is not the error

Any help is greatly appreciated.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,829 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,918 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Marcin Wojciechowski 6 Reputation points MVP
    2022-06-09T10:36:11.103+00:00

    Hi all,
    To enable the app in a team use:
    POST: https://graph.microsoft.com/v1.0/teams/{team-id}/installedApps
    {
    "teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/{app-id-of-your-app-from-teams-app-catalog}"
    }

    1 person found this answer helpful.
    0 comments No comments

  2. Mallipriya-MSFT 91 Reputation points
    2021-01-15T06:23:22.79+00:00

    @Karen Adams , Just to confirm you created teams app > downloaded manifest > made changes to manifest > uploaded it to channel in specific team > then using graph call? Is my understanding correct? Could you please provide repro steps so that help us quickly resolve question.

    0 comments No comments

  3. Manish-MSFT 256 Reputation points
    2021-01-19T09:43:09.577+00:00

    @Karen Adams : In order to add tab in teams, You need to have a corresponding app that must be already installed in that team.

    image

    More info on that here

    I just successfully install/update tab in channel in teams.

    Here are the steps that I followed.

    1. Created a tab and sideloaded in it in teams.
    2. Send a GET request to https://graph.microsoft.com/v1.0/teams/{team id}/channels/{channel}/tabs and got the json data. It will be in the json format as shown below {
      "id": "16824248-f784-4e08-bd57-e3c73947c967",
      "displayName": "AAD SSO Tab Sample",
      "webUrl": "https://teams.microsoft.com/l/entity/69d556a2-7dbc-4ecc-a120-39949a139035/_djb2_msteams_prefix_9a194990-3431-4cb0-a4e7-6a1be263e7f6?label=AAD+SSO+Tab+Sample&context=%7b%0d%0a++%22canvasUrl%22%3a+%22https%3a%2f%2f4d43ec148b9b.ngrok.io%2fssoDemo%22%2c%0d%0a++%22channelId%22%3a+%2219%3ac541d3cdf1664612b53387a5cd4081f1%40thread.skype%22%2c%0d%0a++%22subEntityId%22%3a+null%0d%0a%7d&groupId=f2f36090-8910-4110-a861-cd60147298e5&tenantId=0d9b645f-597b-41f0-a2a3-ef103fbd91bb",
      "configuration": {
      "entityId": "https://4d43ec148b9b.ngrok.io/ssoDemo",
      "contentUrl": "https://4d43ec148b9b.ngrok.io/ssoDemo",
      "removeUrl": null,
      "websiteUrl": null,
      "dateAdded": "2021-01-19T08:22:29.945Z"
      }
      }
      1. Created a POST request to https://graph.microsoft.com/v1.0/teams/{team id}/channels/{channel}/tabs and in response I have added "teamsApp@odata.bind" below with Property with same id which is present in weburl property after /entity/{id} i.e.69d556a2-7dbc-4ecc-a120-39949a139035. Your request must look like below. {
        "id": "16824248-f784-4e08-bd57-e3c73947c967",
        "displayName": "AAD SSO Tab Sample Manish",
        "teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/69d556a2-7dbc-4ecc-a120-39949a139035",
        "webUrl": "https://teams.microsoft.com/l/entity/69d556a2-7dbc-4ecc-a120-39949a139035/_djb2_msteams_prefix_9a194990-3431-4cb0-a4e7-6a1be263e7f6?label=AAD+SSO+Tab+Sample&context=%7b%0d%0a++%22canvasUrl%22%3a+%22https%3a%2f%2f4d43ec148b9b.ngrok.io%2fssoDemo%22%2c%0d%0a++%22channelId%22%3a+%2219%3ac541d3cdf1664612b53387a5cd4081f1%40thread.skype%22%2c%0d%0a++%22subEntityId%22%3a+null%0d%0a%7d&groupId=f2f36090-8910-4110-a861-cd60147298e5&tenantId=0d9b645f-597b-41f0-a2a3-ef103fbd91bb",
        "configuration": {
        "entityId": "https://4d43ec148b9b.ngrok.io/ssoDemo",
        "contentUrl": "https://4d43ec148b9b.ngrok.io/ssoDemo",
        "removeUrl": null,
        "websiteUrl": null,
        "dateAdded": "2021-01-19T08:22:29.945Z"
        }
        }
      2. You have successfully added a new tab

    image

    image

    Thanks,

    Manish Chitre


    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    0 comments No comments

  4. Marvin the Android 1 Reputation point
    2021-11-04T13:51:20.36+00:00

    Hi Manish,

    Did you find a way to install / enable / unblock an app in a teams channel via the graph API?
    I'd like to be able to do that - am using the graph API to provision teams / channels for projects and would like to add apps to tabs as part of the process.
    Thanks!

    0 comments No comments