Get a list of all private channels with Slack API

后端 未结 2 2003
孤街浪徒
孤街浪徒 2020-12-17 17:37

I\'ve been trying to get a list of all \"groups\" in my Slack team. However, even with admin privs, groups.list only provides the groups that the token owner\'s

2条回答
  •  生来不讨喜
    2020-12-17 17:59

    If you really need to monitor all private channels (and DMs) on your Slack workspace in real time there is another approach:

    • Ensure every user on your Slack provides a token to your app. This can be done by each user running through the OAuath installing process for your app once. That will create new token for each user, which you app can collect.
    • Iterate through all active user tokens to compile a list of all conversations (public channels, private channels, direct messages, ..) with conversations.list
    • Iterate through all existing conversations - using a token valid for that conversation - to collect all messages with conversations.history

提交回复
热议问题