Slack – How to Add a Link to Slack Bot Button

botlinksslack

I've created a slack bot, and it sends messages to a channel. I've added a button, and what I'd like to accomplish is having the button redirect the user to an external website.

Is this possible?

The documentation does not indicate you can simply add a URL to the button. Below is the actions array I'm using in the slack bot. It would be awesome if you could.

  "actions": [{
    "name": "Go to order",
    "text": "Go to order",
    "type": "button",
    "value": "Go!"
   }]

Best Answer

Try Slack's Link Buttons, which specifically open links in new browser tabs when clicked.

{
    "text": "Test Link Buttons",
    "channel": "C061EG9SL",
    "attachments": [
        {
            "fallback": "Test link button to https://slack.com/",
            "actions": [
                {
                    "type": "button",
                    "name": "file_request_123456",
                    "text": "Test",
                    "url": "https://slack.com/",
                    "style": "primary"
                }
            ]
        }
    ]
}

Slack Message Builder example