You're doing all the right things, just need to change the order.
Respond to the original request with a
200 OKresponse immediately. See this answerthis answer for details, but essentially:ignore_user_abort(true); ob_start(); echo('{"response_type": "in_channel", "text": "Checking, please wait..."}'); header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); header("Content-Type: application/json"); header('Content-Length: '.ob_get_length()); ob_end_flush(); ob_flush(); flush();Then make the Yoda API request using curl, as you're doing
Once you have the Yoda results, send them to Slack at
$response_urlusing curl, as you're doing.