[使用松弛块api创建链接按钮

问题描述 投票:2回答:1

我希望有一个充当链接的松弛按钮,单击该按钮会将用户重定向到我的网站。松弛的新api有可能吗?

slack
1个回答
0
投票

是,可以使用block kit。您所要做的就是在button内添加actions并提供url。单击后,它将重定向到https://google.com,并向api发送请求。

Block Kit代码:

{
    "blocks": [
        {
            "type": "actions",
            "elements": [
                {
                    "type": "button",
                    "text": {
                        "type": "plain_text",
                        "emoji": true,
                        "text": "Click me"

                    },
                    "style": "primary",
                    "value": "click_me",
                    "url":  "https://google.com"
                }
            ]
        }
    ]
}

输出:Link Button

© www.soinside.com 2019 - 2024. All rights reserved.