0

Using slack slash command i got trigger_id.

Using trigger_id i called dialog and getting response as {"ok":true} but dialog is not appearing in the channel.

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 Answers0