Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I call apps.uninstall method in slack?

Tags:

slack-api

I want to be able to provide the admin an option to remove my slack app from their workspace from my website (kind of like add to slack button but reverse of that).

I have a delete button which calls the apps.uninstall method using the user token (XOXP). However I get a not_allowed_token_type error response.

The web method documentation states that i can use an user token (no scopes) for this method. Any ideas what i am doing wrong?

enter image description here

like image 677
r-puri Avatar asked Sep 12 '18 00:09

r-puri


People also ask

How do I uninstall and reinstall Slack?

From Android based phones and tablets:Under the applications, scroll and select Slack application. Click on Uninstall and select OK when prompted to uninstall the application.

How do I see installed Apps in Slack?

View apps in your workspace From Slack on your desktop, you can view any apps installed to your workspace by other members. To open the app browser, click Apps in the top left of your sidebar. If you don't see this option, click More to find it.

How long until an app uninstalls?

An average app gets deleted in less than six days of install. Also, 3 in 10 users will uninstall an app within 30 days. But all is not left to chance. You can predict the reasons that will get your app to be deleted days after install.


1 Answers

The reason why you get this error is that apps.uninstall only works with workspace apps and workspace tokens. Workspace apps is a new kind of Slack app, that is currently still in development and available under "Developer Preview"

I could not get it to work either for my Slack app, so opened a support ticket and got this answer from the Slack team. Its actually stated in the documentation, but it also wrongly states that you can use a user token. The alternative solution is to use auth.revoke to revoke all tokens from your applications.

Here is what the documentation says:

This method uninstalls a workspace app. Unlike auth.revoke, which revokes a single token, this method revokes all tokens associated with a single installation of a workspace app.

Here is the reply I got from the Slack team in full:

apps.uninstall is only for workspace apps. There's no way to revoke every token for a traditional app, you'll need to use auth.revoke on each token. This is on the documentation page but its pretty hard to see (and actually incorrect as it states you can use user tokens which is incorrect).

like image 95
Erik Kalkoken Avatar answered Sep 20 '22 20:09

Erik Kalkoken