Webhook Endpoint / Listener Example

0
Hi Everyone,   I need to add a function to my Mendix app that will listen for changes in an external system by providing an endpoint for a webhook to send a GET request to. My application doesn't need to respond to the request, just take the body of the request and then work with the data in the request body internally.    The system I'm trying to integrate with will accept a webhook endpoint and send (as a GET request)  the data to that endpoint accordingly. As an additional wrinkle, the external system can only send requests to https endpoints, so localhost:8080 is no use for testing.   I've searched this on the community but most of the previous questions appear to be about sending data out of a Mendix app where I need to accept data coming in. I have read through the documentation for adding a Consumed REST Service here and that has given me the basics, but I need to build and test this integration with the external system and the need for that https URL is tricky.   Has anyone gone through this before or who might have examples I can follow through? Would I need to create a paid / published node for testing (this is fine, I just need to know) or are there documents out there that would help walk me through how to do this properly?   Thanks in advance!
asked
2 answers
1

You can do this in Mendix by adding a "publish rest document". GET is typically not used for sending data to a service in a body though, would expect POST or PUT.  

 

For more info: 

* https://www.mendix.com/blog/publishing-rest-apis-in-mendix/

* https://docs.mendix.com/refguide/published-rest-services/

 

Easiest for https testing is probably to use something like ngrok to forward messages to your dev machine.

answered
1

Hi Everyone,

 

For anyone who has been looking at the same challenge as me here, the links postedby Andrej are invaluable and well worth a look for the key info. I also came across a blog post by Ryan Mocke here : How to make a Slack Bot with Mendix which steps you through the entire process and got me right where I needed to be!

 

Hope this helps!

answered