CodeIgniter Forums
Processing webhooks - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forum-31.html)
+--- Thread: Processing webhooks (/thread-78576.html)



Processing webhooks - superior - 02-09-2021

Hello,

I'm rewriting my entire application to the new CI4, the application can receive webhook actions from different providers (atleast 3). What should be the best way to process these actions.

My initial thoughts was writing a different controller for all webhook actions, this is done in CI3 as well to keep information in good order. Is there a simple of efficient way in CI4 or can i use the same approach?

Requires:

  1. Query update on table(s)
  2. Log in database to keep track
  3. It's only incomming POST request nothing more.

Have been reading about the routes as well, i think i should use the post() but can this work allong with the CSRF check or should CSRF exclude these actions?

EDIT:
Found the solution for CSRF, it needs an excluded URL.
Did this by excluding the requested URL according to the documentation.

Thanks for the advice!