Creating a Slack Webhook programmatically

≡放荡痞女 提交于 2019-12-14 02:18:41

问题


Is there a way I can use the Slack API to create an incoming and outgoing webhook for a channel I just created?


回答1:


No, I do not think that feature exists, but you can just use any existing webhook with the newly created channel or use the Event API to get the same result.

Incoming Webhooks

You can redirect an incoming webhook to any channel by providing the channel name as parameter in your call. (see Channel override)

Outgoing Webhooks

Your existing outgoing webhook will work with any channel, as long as you use triger words when you created them. If that is not an option, I would recommend to look at the new Event API that would allow you to get the same functionality as with outgoing webhooks, but without having to provide a channel name in the first place. Check out the event types message.channels and message.groups.



来源:https://stackoverflow.com/questions/40370319/creating-a-slack-webhook-programmatically

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