没有收到来自在Interactive Component

时间:2019-07-15 06:29:49

标签: asp.net-mvc slack slack-api

从我的应用程序使用chat.postmessage并在json请求中使用按钮来松弛地发送消息。但是当用户从空闲状态单击按钮时,不会在请求URL上返回响应。

https://api.slack.com/messaging/interactivity/enabling#responding_to_interactions

正如上面链接中提到的,我已经设置好结构。设置请求网址以及具有回调ID的操作。在我的应用程序中还设置了请求URL方法。我已检查我的应用程序的请求URL是否正常。

附件参数通过json传递如下

[
  {
    "text": "Are you want to turn of this messages?",
    "fallback": "You are unable to turn off",
    "callback_id": "turn_off_message",
    "attachment_type": "default",
    "actions": [
      {
        "name": "turnoff",
        "text": "Turn Off",
        "type": "button",
        "value": "turnoff"
      }
    ]
  }
]

用户单击“关闭”按钮后,需要对我在Interactive Component中设置的“请求URL”进行响应。

1 个答案:

答案 0 :(得分:-2)

最近我遇到了同样的问题,现在我发现我的代码中没有任何问题。问题是我没有正确配置我的Slack应用。 按照此链接配置您的松弛应用 github python slack tutorial