Uninstall ms teams app / bot for a user ( bot framework bot ) - microsoft-graph-api

Is it possible to uninstall a bot for a user in ms teams using some MS graph api or any other method? We have a user which is not able to talk to a bot in teams. It used to work before, but lately every messages user types runs into an error. So we were thinking to delete / uninstall the bot for that user and, have him install again.

There is an endpoint that you should be able to use for this: https://learn.microsoft.com/en-us/graph/api/userteamwork-delete-installedapps?view=graph-rest-1.0&tabs=http . Would it not be easier to just have the user uninstall the app in Teams though (right click on the app's icon and select 'Uninstall').
That said, I don't know if it would help - it sounds like something else might be wrong. Is this the only user having the issue? If everyone is seeing it, you should check if the Teams 'Channel' is enabled in the Bot's settings in the Azure resource (here's more info: https://learn.microsoft.com/en-us/azure/bot-service/bot-service-manage-channels?view=azure-bot-service-4.0).

Related

Is there any way to get user id/conversation reference to proactively message user on teams if installation event wasnt captured

Looking for the best course of action that would have the least impact on users to be able proactively message users with teams app (bot) installed but where they have not messaged the bot and the conversation reference was not captured at time of install.
The scenario is that have an enterprise bot that has been operational for over 3 years servicing 10s of thousands of employees. The bot is auto installed for all users in the tenant, but conversation references were only being stored in the last 2/3's of the applications life, and the install event was not being captured until recently. This was not an issue in past as all proactive functionality was predicated on some interaction with the bot.
I now have a need to be able proactively messages all users within tenant regardless of if they have messaged the bot or not, or if they last messaged the bot before conversation references were being stored. There are only a small subset of users the fall into this category.
Hoping some way to generate a conversation update, be it through graph or other means. The installationUpdate event through app update seemed promising as can update the application but seems only triggered if bot is added or removed
Review the information provided here: https://learn.microsoft.com/en-us/microsoftteams/platform/graph-api/proactive-bots-and-messages/graph-proactive-bots-and-messages?tabs=dotnet
Here is what we do
If we have the conversation ID in our cache/persistent store, we use
it to send the message
If we dont have, we use GET
https://graph.microsoft.com/v1.0/users/{user-id}/teamwork/installedApps/{teamsAppInstallationId}/chat
to get the chatid (the app id here is not the bot application ID, but the ID generated when the app is installed in the org app store and is available from the Teams Admin interface)
If the user does not have our app installed, we
install the app using the teamsAppInstallationId ID. This automatically generates a event without user intervention that
is sent to the bot which you can then use to capture the conversation ID.
POST /users/{user-id | user-principal-name}/teamwork/installedApps
This approach does require an Application Permission: TeamsAppInstallation.ReadWriteSelfForUser.All
You might look into using the List Teams functionality in the Graph API. You can use Graph to get teams and list their members, assuming you can grant your bot the necessary permissions. There are many features in the Graph API which might help you accomplish this.
To send a proactive message to user the bot requires the conversation reference. The conversation can be only retrieved when bot installed.
Without conversation reference you cannot send a proactive message using bot.
You can use Send message in a chat API to send message to chat with delegated permissions.
Could you please raise a uservoice for your case

How can a MS Teams admin install custom apps to their users so that I receive conversation_id of all their users

I am building a custom app for MS Teams that sends Proactive chat messages to the users of each of the teams. When I give the app to the teams admin, they will publish the app, but I am not sure how the admin will install for their users, so that I receive conversation_id of all the users in their teams after it has been installed.
I am aware that it is possible through Graph API and is looking to eliminate the app installation through Graph Api.
It's possible for an admin to do this using the Teams Admin section in the Microsoft 365 Tenant Admin screens. Specifically, you're wanting to set up something called "App Setup Policies". See here for more: https://learn.microsoft.com/en-us/microsoftteams/teams-app-setup-policies#create-a-custom-app-setup-policy
Using these policies, admins can pre-install the app, and can even pin it on the left menu. They can also choose to do this for all users, or just a specified group.
To be clear though, this will install the app to the users in a -personal- context - it will NOT install the app to any -actual- Teams / Channels or Group Chats - you'd need to use Graph for that, and even then it will only be able to install to -existing- Channels or Chats and won't automatically cover new ones added after that, if that's what you were trying to achieve.

Feature I want to add to my Amazon Connect scheduling app

So we wrote a React app that lets call center admins create holidays, special events, meetings and emergency conditions for Amazon Connect. In version 2.0 I would like to be able to allow admins to use an uploaded pre-recorded prompt and select that for an announcement from my React app. I have searched the API and it has no endpoint for listing or creating prompt. Does anyone else know if this is possible?
There is currently no API for Prompt Management. Right now, you would have to manually reference the ARN value of the Prompt to dynamically play it via a lambda within a contact flow. Just looked into this myself for a similar feature, and confirmed w/ AWS team.

How can I let an iOS Teams App user use my Bot without inform the MicrosoftAppId?

I want Teams users to use my Bot.
But I don't want to inform the MicrosoftAppId of the Bot for the users.
According to this site : https://msdn.microsoft.com/ja-jp/microsoft-teams/botsadd
I tried the way 1(select Add to Microsoft Teams) and the way 3(Get or create a deeplink)
(I skipped the way 2 since it needs information about MicrosoftAppId)
Those ways worked for users using Teams in Windows PC.
But they never worked for users using Teams in iOS Moblie.
So, how can I solve the problem?
Is there any other way to let the users use my Bot without inform the MicrosoftAppId?
The implicit registration of a bot from mobile device is not supported yet. In order to discover a bot, user need to invoke the bot at least once from desktop client/web.
Alternatively, you could sideload your bot in perticular team by creating an app manifest file. Sideloaded bots can be discovered by all the members by bot name.

Create slack channel using slack app

I have a private slack application (developed by user 'X' from team 'XT')
I have a web server knows how to complete the Oauth process and generate tokens per teams
Now- as a user Y from team YT I am installing the slack app on my YT team and get a token,
using that token I perform API call for channels.create ,
I got into my team (aka YT) and indeed I see that the channel was created ,
BUT
it's written that the channel was created by the specific user that installed the slack app, meaning user Y.
I would expect to see that channel was created by the application not by specific user.
Is there any way to do that ?
thought about using bot token (got from the app instllation) but channels.create cannot be performed by a bot
I am afraid there is no solution for your problem. Every "write" action on Slack has to be attached to either a bot or a user. And since channels.create can not be used by a bot, it has to be a user.
The master access token of your Slack app is linked to the user that installed it, which is why that user will appear as creator of the channel when you use it.
I use a generic admin user ("slackadmin") for that purpose on my own Slack, but that will of course not work as general solution for each Slack team that want to install your app from the Slack App Directory.

Resources