0
votes

In a Slack conversation, is it possible to click on a button to send a message to the Slack channel?

The Slack conversation could be:

  • The user types a word (or message)
  • A slackbot shows some text and two buttons
  • The user clicks on a button to send a TEXT message to the Slack channel
  • The Slackbot reacts on the 'action' message.

It is not possible to create an REST service for my Slackbot, because the Slackbot is behind a firewall. So, registering commands is not possible.

So sending a message as the result of a button click is needed. The Slackbot can react on that message.

I read that attachments could be a good way to do this, BUT the is 'outmoded'.

I tried to send an secondary attachment, which is outmoded, but that was not possible. The next approach was adding a webhook. So pushing a button resulted in using the url, but that is of course not possible because I cannot send a POST request via a simple (get) url.

Please give a short example.

1

1 Answers

0
votes

This will not work.

Every interactive feature (e.g. buttons) require your app to be able to receive POST requests from Slack through the public Internet. Since you say you can not provide that (e.g. behind a company firewall) you will not be able to use any interactive features.

See also this answer: How to integrate internal APIs (Not accessible outside office network) to slack slash commands