How to get notified when the slack app is installed?

落花浮王杯 提交于 2021-02-05 09:23:05

问题


I have a requirement where I have to do some preliminary setup for my slack-bot. What I want to do is:

  1. Get the notification when my slack app is installed to a workspace.
  2. Send a private message to the admin of the workspace with instructions/setup manual.

I am looking at slack event API docs and it looks like that it does have an app uninstalled event, but nothing related to install.

How would I achieve above mentioned goals for my slack bot? Can I do that with event api or do I have to use RTM?


回答1:


There is no event for app install, because you do not need one.

To install an app the user has to go through the mandatory OAuth2.0 process to authenticate your app for a workspace. So you app will always get an OAuth request and later in the process the details about the team and user who is installing your app.

You also can just send a private message to the installer once the process is completed and you have the token.

The OAuth process has its own API methods and is not part of RTM or Event API.

Here is a link to an implementation example in Python on how the installation process works: Installation Example



来源:https://stackoverflow.com/questions/57815090/how-to-get-notified-when-the-slack-app-is-installed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!