r-puri
r-puri

Reputation: 149

How do I call apps.uninstall method in slack?

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

Upvotes: 7

Views: 683

Answers (1)

Erik Kalkoken
Erik Kalkoken

Reputation: 32852

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).

Upvotes: 6

Related Questions