Search code examples
botframeworkmicrosoft-teams

How to retrieve conversationId for notification only bot which was already installed?


I created a notification only Bot for MS Teams app for proactive notification. I was able to successfully install the bot and also received ConversationUpdate event, from which I saved conversationId for future notifications. However, there might be some situations when the conversationId could not be saved, maybe because of high volume of data or some bug in our codebase or server issue or some other reason. How to retrieve conversationId in these situations? Is there a way that we can acknowledge whether the ConverationUpdate event was successful, so that the event can be retried upon failure.


Solution

  • I've not actually tried this, but I think you can do this via the graph. I think it will require two steps:

    1. get the app info: https://learn.microsoft.com/en-us/graph/api/userteamwork-list-installedapps?view=graph-rest-1.0&tabs=http (i.e. the specific installation ID for this app to this user)

    2. get the details of the specific app/user conversation: https://learn.microsoft.com/en-us/graph/api/userscopeteamsappinstallation-get-chat?view=graph-rest-1.0&tabs=http