This feels like it's an easy one to add, but i might be wrong.
The API will call a provided url for any given hook.
The questions that remain are:
Webhooks can be implemented through event hooks
We will create a new database table directus_webhooks with 4 column
In web.php we will find and attach all the webhook to related hooks in the system, and then call the same callWebHook($action, $url, $data) as mention in Filesystem approach
Webhook menu under Admin section where admin can manage webhook via App.Webhook just like Files and Users and Api endpoint.GraphQL also as we have a separate API endpoint here.callWebHook($action, $url, $data)callWebHook() will do a CURL request to given $url$data.How Directus Cloud support Filesystem based Webhook? Do cloud support execution of custom PHP code?
How Directus Cloud support Filesystem based Webhook? Do cloud support execution of custom PHP code?
It doesn't. There's no way for the end user to upload any custom extensions or code that's run.
The main use case for having web hooks (as of right now) is to ping an external service to either A: re-generate a static website, or B: process the saved data in another way (like send an email (SendGrid) or save it to a google doc or something.
It would be nice if there was a fifth column that allows for some additional options and settings. Being able to choose what format the payload has that goes to the external service would be extremely useful. You could for example use this setup to automatically create a release on GitHub that has the same information as the stuff you just entered in Directus, which makes Directus a control center for your app. Alternatively, being able to store credentials for these endpoints would be really useful too (so you can authenticate against SendGrid or whatever0
Just to connect the respective App ticket: https://github.com/directus/app/issues/1058#issuecomment-435046232
This mockup (pulled from GitHub's design) also has a content_type (as Rijk mentioned), a status column, and a secret column. Not sure if that helps! :)
Also, I guess the collection field would need to be conditional — and would we allow this to be a CSV, or would multiple collections require multiple hooks?
Key points missing in the discussion:
Most helpful comment
Key points missing in the discussion: