Sending Email Notification when Published API encounters BAD Request

0
Hi everyone, I was wondering if anyone had tried to achieve the following before. So we have a Published Rest Service where our client will be able to use the API to input Master Data to be stored in Mendix. However, there is request to send email notifications should there be any errors when they try use the REST Service. I was thinking of adding the send email microflow from the email module in the PRS microflows. But I’ve done some basic tests and found that if there is a BAD Request(Error 400), it doesn’t actually go through the microflow at all. So my question is basically is if its possible at all to do something like this? Any help would be much appreciated. Best Regards Kevin
asked
1 answers
1

Hi Kevin,

If its a sync call from the other app, then I’d suggest to do this with response codes – they will be sent out even in cases of Bad responses and I think that’s much more universal and gives options on the calling application to handle errors gracefully. 

I’m not quite sure why email would be required to capture Bad requests errors as the consuming application has not followed proper usage and passed expected input parameters, this means more of an error at the consuming side rather than the publishing side. But as you mentioned that if its a Bad request then it does not call the microflow, I don’t think that there is other way apart from sending response codes.

Hope it helps!

answered