Share via

Notifications on Teams Tab not working

David Cabielles Hernández 21 Reputation points
2022-02-21T18:25:21.81+00:00

Hi,

I'm developing a Teams App based on a Tab (no team, no bot, just a Tab).
I'm trying to send notifications to the app but I get the following error:
"message": "The app installation id, 'XXX', provided in the topic is not a valid app installation id.",

The access token is working fine, but I can't find any info about this error. I added the permissions as are specified here: https://learn.microsoft.com/en-us/graph/api/userteamwork-sendactivitynotification?view=graph-rest-1.0&tabs=http

My request is this: https://graph.microsoft.com/v1.0/users/MYUSERID/teamwork/sendActivityNotification

And my request body is the following:

{  
    "topic": {  
        "source": "entityUrl",  
        "value":  
        "https://graph.microsoft.com/v1.0/users/MYUSERID/teamwork/installedApps/XXX"  
    },  
    "activityType": "messages",  
    "previewText": {  
        "content": "New Task Created"  
    },  
    "templateParameters": [  
        {  
        "name": "taskId",  
        "value": "Task 12322"  
        }  
    ]  
}  

My ID for the app is the id showed on azure, but I can't do nothing with this error.

Thank you in advance!

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other

Answer accepted by question author

Nivedipa-MSFT 4,246 Reputation points Microsoft External Staff Moderator
2022-02-23T07:48:45.317+00:00

Adding answer from comment section for more visibility.

You have to use the INSTALLATION ID of the app instead of APP ID

You have to recover the INSTALLATION ID of the app.

You can recover it on the next endpoint:
https://graph.microsoft.com/v1.0/users/{USERID}/teamwork/installedApps?$expand=teamsApp,teamsAppDefinition&$filter=teamsApp/externalId eq '{APP ID OF THE MANIFEST}'

Ref Doc: https://learn.microsoft.com/en-us/graph/api/userteamwork-list-installedapps?view=graph-rest-1.0&tabs=http#example-3-get-the-app-installation-resource-based-on-the-manifest-id-of-the-associated-app

Thanks,
Nivedipa


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.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.