Reputation: 8047
I want to have a slack button that will behave as a link, it will send user to my website when it clicked. Is that possible with slack new api?
Upvotes: 4
Views: 6787
Reputation: 2143
Yes, it is possible by using block kit.
All you have to do is add a button
inside actions
and provide the url
. On click it will redirect to https://google.com and also sends a request to slack api.
Block Kit Code:
{
"blocks": [
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"emoji": true,
"text": "Click me"
},
"style": "primary",
"value": "click_me",
"url": "https://google.com"
}
]
}
]
}
Upvotes: 12