Not receiving Slack interactive payload

685 views Asked by At

I have set up a notification with action buttons, but I do not receive the in interactive payload. I have configured the webhook URL here: Slack app settings

When I post to that URL in Postman everything is fine. But when I press the buttons I get no callback to that URL I get nothing(I'm logging all requests to that URL). I also get a warning triangle next to my buttons like this: Warning

I get no other feedback and no Ideas where I should debug.

The massage with the buttons is published with Laravel's Slack notification channel plus this package for block support: https://github.com/nathanheffley/laravel-slack-blocks

This is the code for sending the notification, but I don't think it is relevant:

public function toSlack()
{
    $model = $this->model;

    $message = (new SlackMessage())
        ->error()
        ->content('New report!');

    $message->attachment(function ($attachment) use ($model) {
        $attachment->block(function ($block) {
            $block
                ->type('actions')
                ->elements([
                    [
                        'type' => 'button',
                        'text' => [
                            'type' => 'plain_text',
                            'text' => 'Approve',
                            'emoji' => false,
                        ],
                        'value' => 'click_me_123',
                        'action_id' => 'approve_x',
                        'style' => 'primary',
                    ],
                    [
                        'type' => 'button',
                        'text' => [
                            'type' => 'plain_text',
                            'text' => 'Reject',
                            'emoji' => false,
                        ],
                        'value' => 'click_me_1234',
                        'action_id' => 'reject_x',
                        'style' => 'danger',
                    ],
                ]);
        });
    });

    return $message;
}

Any ideas how I should proceed with debugging?

1

There are 1 answers

0
Pelmered On

Today, I noticed that I got some more information if I hoovered the triangle, but I'm pretty sure that didn't work yesterday. I got the message "500 server error" there.

The problem was that the payload JOSN is sent as a form-data field and not in the POST request body like normal. Why do they send the payload like this? It makes no sense.