Recommended place for webhooks?

Hi,

I need my CUBA Application to receive calls on a webhook, that webhook uses a GET parameter for authentication (a token) so I do not need any authentication magic there.

But I do need a predictable URL and to have all CUBA services available to me on the handler.

Where would I put such code and how would I expose it?

The handlers are mainly: a) receive Mailjet webhooks b) call from a google cloud function to update some data c) receive google pubsub messages

thanks,
marc

PS: I’m on CUBA 7 beta 2, not adding the beta tag as I guess this question / answer is not only applicable to 7b2

Hi Marc,
Accessing standard CUBA REST API with a different authentication method won’t be a simple task. I suppose you need a limited set of things to be done using webhooks. If so, then the easiest way will be to create custom Spring MVC controllers, register them in dispatcher-spring.xml and in these controllers analyze request parameters values and invoke any required middleware service.

1 Like