Slack conversation.list api is not listing private channels as well as direct messages where the bot is part of

43 Views Asked by At

Im using the bot token to get the channel list, but im only getting the public channels not private channels and DMs where the bot has been added to

Here is the permission i have

channels:readgroups:readim:readmpim:read

const response = await axios.post('https://slack.com/api/conversations.list', {
        exclude_archived: true,
        types:
          "public_channel,private_channel,mpim,im"
      } ,{
        headers: { Authorization: `Bearer ${accessToken}` },
      });
      const channels = response.data.channels;
    
      const channelList = channels.map((channel) => {
        if(!channel.is_archived){
          return{
            channel_name: channel.name_normalized,
            channel_id: channel.id
          }
          
        return undefined;   
      })
      .filter((channel) => channel !== undefined)

The bot token will be something like this xoxe.xoxb-1-MS0yLTUyNjI5ODk.......

Why i cant get the private channels ? the bot has been authorized in the workspace.

0

There are 0 best solutions below