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

rayzor's avatar

Processing Incoming Webhook notifications

I've gotten all my parsing etc. done for a JSON file that I download. The ultimate goal is to process a nightly JSON file sent via a webhook. I think I'm working on vapors as I'm really confused where to start to read the notification and get the URL. Probably something SO simple, but I'm not having luck finding a basic answer.

I've set up a route for the hook to fire against but what I need is to get the file name so I can have the parser process it. Here is what the notification will look like.

{
  "report_id": 1234,
  "schedule_id": 4567,
  "download_link": "https://app.website.com/report_center/reports/1234/schedules/4567/download?code=6a5e838b3cb1373b7dc5a89f66",
  "report_filename": "SomegreatReport.json"
}

When it hits the page how do I start processing the "download_link" and sending it to the parsing process?

Thanks and sorry for the rookie questions.

0 likes
2 replies
aurawindsurfing's avatar

Hi @rayzor

Your webhook will come to application as a post route:

Route::post('webhook', 'WebhookController@handle');

You need to disable csrf token for that route in the VerifyCsrfToken middleware:

add:

protected $except = [
    'webhook',
];

Then do:

class WebhookController extends Controller
{
    public function handle(Request $request)
    {
        dd($request);
    }
}

in your controller's handle() method to see what you are getting.

Should be straight forward from there.

Also since laravel 7.0 it is easy to test your own application webhooks from within your application: https://laravel.com/docs/master/http-client#request-data

if not then just use https://www.postman.com/

Hope it helps!

rayzor's avatar

Thank you! I’ve just tried moving my code to a shared host and it died. But baby steps!

Please or to participate in this conversation.