Reputation: 1670
I am trying to clear out all Slack message history using Slack's API. I am using the im.list
method https://api.slack.com/methods/im.list, which only appears to list direct conversations between my logged in user and other users. I would like to return (or just delete) messages between other users. I know it may be a privacy risk to allow an admin to access these messages, but surely there must be a way to delete them somehow?
Upvotes: 1
Views: 222
Reputation: 1670
Here's a solution that worked for my particular use case:
*This (imperfect and tedious) method will incur costs unless you have a Slack credit like we did.
Upvotes: 1
Reputation: 32852
Due to Slack's security architecture your Slack App can only see conversations, which either the installing user or the apps bot user is a member off. That includes IMs between other people. And it does not matter if your user is admin or owner.
Thers is one solution though: get user tokens of all you Slack members and use them to get access to those other IMs and private conversations.
This is possible by letting each user install your Slack app (which creates additional "configurations" of your Slack app) and thereby collecting all the user tokens.
Upvotes: 1