Slack channels created using Slack API (and bot token) not showing up after posting a message to it

52 Views Asked by At

I created several Slack channels using the Slack API and Bot Token, all necessary permissions are enabled. I am able to create the channels and send message to it successfully. Now the issue is, the channel doesn't show up automatically in the Slack channels list, but when I browse the channel manually, I can see the posted messages.

I'm using the Slack conversations.create and chat.postMessage API methods. I've also tried using conversations.list, conversations.join, conversations.open but the channel is not showing up yet.

enter image description here

1

There are 1 best solutions below

0
John Zenith On

After in-depth investigation with the API, I was able to show the created channels on the Channels list.

[Option 1]

  • If you create the channel with conversations.create and Bot Token, you have to use User Token when calling conversations.join API method.

[Option 2]

  • You may decide to use just user token and call the conversations.create and conversations.join API methods.

[Option 3]

  • If you create the channel using conversations.create API method and a user token, you don't need to call conversations.join to join the channel if you have channels:read (public channel) or groups:read (private channel) permission enabled, the channel will become visible on the Slack Channels list.

Looks like only a User Token can be used to add a Slack channel to the Slack Channels list.