Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

wonder95's avatar

Slack Interactivity callback not being called in prod only

In my large Laravel/Vue app, we are sending messages to Slack channels that contain a button with a URL that links the user to the page in our site that generated the message. With any button there are many interactive things you can do, so you have to define an Interactivity callback URL in your app, and Slack will POST a call to it providing various pieces of info that you can react to. When you click the button, this callback is supposed to return a 200 response within 3 seconds; if not, when you click on the button, a `403 error is displayed next to it.

In our setup, we have that URL defined and it is a callback that merely returns an HTTP 200 message. If I run a local setup using ngrok, and send a message to our workspace, when I click on the button, the configured URL is used, our callback is called, and no 403 message is returned. However, in our prod setup, we consistently get a 403 error, with the exact same code/setup. Slack support has been, shall we say, less than helpful, so I'm not sure where to go.

I know this is more Slack than Laravel/Vue, but I'm just looking for options for troubleshooting this and figuring the cause of the error. I can see nothing on our end that would cause this issue.

0 likes
2 replies
LaryAI's avatar
Level 58

To troubleshoot and resolve the issue where your Slack Interactivity callback is not being called in production but works locally, you can follow these steps:

  1. Check Production URL Configuration: Ensure that the callback URL configured in Slack for your production environment is correct and accessible from the internet. Sometimes, a typo or incorrect URL can cause the callback to fail.

  2. Verify SSL/TLS Configuration: Slack requires that the callback URL uses HTTPS. Ensure that your production server has a valid SSL certificate and that the HTTPS endpoint is correctly configured.

  3. Check Server Logs: Look at the server logs in your production environment to see if there are any errors or issues when Slack attempts to make the POST request. This can provide clues as to why the request is failing.

  4. Firewall and Security Groups: Ensure that your production server's firewall or security groups are not blocking incoming requests from Slack's IP addresses. You may need to whitelist Slack's IP ranges.

  5. CORS Configuration: Although CORS is typically a client-side issue, ensure that your server is not misconfigured in a way that might block requests from Slack.

  6. Debugging with Ngrok in Production: Temporarily set up ngrok in your production environment to tunnel the callback URL. This can help you determine if the issue is with your server configuration or something specific to the production environment.

  7. Response Time: Ensure that your callback endpoint responds within 3 seconds. If your production server is slower or under heavy load, it might be causing the timeout.

  8. Return a 200 Status Code: Make sure your callback endpoint always returns a 200 status code within the required time frame. Here is a simple example of a Laravel route that does this:

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;

Route::post('/slack/callback', function (Request $request) {
    // Log the request for debugging
    Log::info('Slack callback received', $request->all());

    // Perform any necessary processing here

    // Return a 200 response
    return response()->json(['status' => 'ok'], 200);
});
  1. Check Slack App Configuration: Double-check the configuration of your Slack app to ensure that the Interactivity & Shortcuts settings are correctly pointing to your production callback URL.

  2. Network Tools: Use network tools like curl or Postman to manually send a POST request to your production callback URL to ensure it is reachable and responds correctly.

Example curl command:

curl -X POST https://your-production-url.com/slack/callback -d 'payload={"type":"interactive_message"}'

By following these steps, you should be able to identify and resolve the issue causing the 403 error in your production environment. If the problem persists, consider reaching out to your hosting provider for additional support, as there may be server-specific configurations affecting the callback.

wonder95's avatar
wonder95
OP
Best Answer
Level 5

To avoid being DenverCoder9, the cause of the problem was that the Slack request was blocked by Cloudflare, so we put a rule in place to bypass the managed rules for our Slack webhook URLs.

Please or to participate in this conversation.