Create slack channel using slack app

♀尐吖头ヾ 提交于 2019-12-11 06:19:57

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/41115905/create-slack-channel-using-slack-app

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