0

I am successfully able to add a Custom Tab to a Team / Channel via Programmatically Create Channel Tab (not from Configure popup)

However, the POST request shape looks something like

{
    "displayName": "my-title-display-name",
    "teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/bd839104-9f20-4a1f-bbb9-226897156642",
    "configuration": {
        "contentUrl": "https://myurl.com/index.html",
    }
}

the problem is determining the "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/bd839104-9f20-4a1f-bbb9-226897156642"

part

The "bd839104-9f20-4a1f-bbb9-226897156642" GUID here does not work, even if it is defined in my manifest.json:

(the error message is

Microsoft.Graph.ServiceException: 'Code: InvalidRequest
Message: App id bd839104-9f20-4a1f-bbb9-226897156642 needs to be installed to the team 07331d69-xxxxx and be in an unblocked state to install/update a tab

)

{
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
    "manifestVersion": "1.5",
    "version": "1.0.44",
    "id": "bd839104-9f20-4a1f-bbb9-226897156642",
    "packageName": "software.random.com",
    "developer": {
        "name": "Random Software",

(etc)

I used the Microsoft Graph /teams/id/installedApps and found a random GUID (the last one in the list, my custom app) and used that GUID successfully. (it is base64 encoded)

Question

How to I map from the manifest.json ID to the installedApp id?

I see the difference between the developer generated id and the AppCatalog Id; but only Global Admins have access to this graph endpoint (ref https://learn.microsoft.com/en-us/graph/api/teamsapp-list?view=graph-rest-1.0)

NickHodge
  • 313
  • 3
  • 10
  • With Groups.ReadWrite.All you can GET query the `installedApps` this returns a list of Apps, and if you expand the sub-query into `teamsAppDefinition` you get the names `https://graph.microsoft.com/v1.0/teams/{groupId/installedApps?$expand=teamsAppDefinition` The property `teamsAppId` in the sub-collection is your friend. You still have to iterate through the returning list as the following "sub-filter" with oData doesnt work. `https://graph.microsoft.com/v1.0/teams/{groupId/installedApps?$expand=teamsAppDefinition($filter=startswith(displayName,'randomappname'))` – NickHodge Dec 03 '19 at 07:27
  • 1
    Did you tried to set entity id with in your request body while creating channel tab through Graph API? Please take a look at [Add Tab to channel](https://learn.microsoft.com/en-us/graph/api/teamstab-add?view=graph-rest-1.0) using Graph API – Trinetra-MSFT Dec 06 '19 at 03:48
  • Are you still facing this issue? – Trinetra-MSFT Dec 10 '19 at 09:52
  • All fixed. I decided to follow the /installedApps? route to get this to work. And it does. (as of yesterday :-) ) – NickHodge Dec 11 '19 at 21:50

0 Answers0