I am looking for a call which could send a Slack team invitation email to a new user from my application. I searched it in the SlackAPI but I didn't find anything. Is it possible to create an application which would sent invitations on my behalf?
I'm currently using slacker as a Python wrapper, but if there is any better library which provides invitations I can start using it.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is an undocumented method in the Slack API that does it.
- method name:
users.admin.invite
- arguments:
token
,email
,channels
- token: your slack API "test" token (required)
- email: email address, e.g.
email=test@email.com
(required) - channels: comma separated list of channels the new user will auto-join. channels are specified by ID. e.g.
channels=C000000001,C000000002
(optional)
full example:
https://slack.com/api/users.admin.invite?token=XXX&email=test@email.com&channels=C000000001,C000000002
I started documenting the "undocumented" Slack API methods I know about including users.admin.invite
. Check out the documentation on github.
回答2:
Looks like this stopped working as it requires the scope "clients" to be added yet if you try to add that scope to the token process it replies with "cannot add deprecated scope"