通过api调用Slack斜杠命令时不显示对话框

时间:2018-08-23 06:58:09

标签: slack-api asana-api

使用松弛斜杠命令我得到了trigger_id

我使用trigger_id呼叫了dialog,并以{"ok":true}的身份进行响应,但是对话框未显示在频道中。

public function sendDialogs($trigger_id) { 

 $json = '{
  "callback_id": "ryde-46e2b0",
  "title": "Request a Ride",
  "submit_label": "Request",
  "notify_on_cancel": true,
  "elements": [
    {
      "type": "text",
      "label": "Pickup Location",
      "name": "loc_origin"
    },
    {
      "label": "Assignee",
      "name": "bug_assignee",
      "type": "select",
      "data_source": "users"
    }
  ]
}';

$json = urlencode($json);
$dialog = $json;
 $send_diaglog_url = $this->path_url . "dialog.open?token=$this->slack_bot_token&dialog=$dialog&trigger_id=$trigger_id&"&pretty=1; 

 return $this->guzzle->request('POST', $send_diaglog_url)->getBody()->getContents(); 

}

0 个答案:

没有答案