0

I want to export direct messages (im and mpim) from a new -but already in use- workspace I administrate.

Legacy tokens are completely deprecated now from Slack so I've created and installed an app into my workspace and granted it the permissions I need. Using this version of the slack-export script with my bot token I'm able to export public channels, private channels and messages in which the bot is included as a user.

Now let's say users A, B and C have been into a conversation (mpim), it will get an id and the name mpdm-userA--userB--userC-1, and I won't be able to export it since its out of the bot user scope. I they start a new chat including the bot user, the script will export the chat from now on, but it will obviously have new id and name.

So is there a way to get IM and multiparty IM using the new bot token policy in the Salck API?

1 Answers1

0

The new bot token does not change how the fundamental security architecture of Slack works. A user (or bot user) still needs to be member of a private / direct message channel in order to have access to it. It does also not matter what permission or role you have. Even the primary owner has no access to private channels he is not a member of.

So with your app you have a bot user. That bot user need to be a member of those private / direct message channels you want to export.

Or your app needs to get a user token from a member of the private channel.

The only official alternative is to make a direct request to Slack for the data. And they are some other approaches. Check out this answer for details: Slack: Retrieve all messages

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114