Throwing an Error using Post Submit HookAnswered
I am presently working on Custom Integration. I am facing a challenge where the API responds with a few custom error codes in the response. So I want to throw an error whenever I get an error in the body. I know we can use Post Submit Hook to ignore an error. Can anyone let me know how can I throw an error & fail the integration?
I think it would help if you posted the exact HTTP response body so we can see what you are dealing with (a screenshot of postman would work), and then please also share a screenshot of your export or import configuration. There are a bunch of fields in the export/import bubble drawers to handle non standard API response patterns.0
Hi Scott, thanks for taking out your valuable time and responding to me.
I am attaching the API response screenshot below for reference.
I was facing the challenge because the API is designed such that it gives 200 Status Codes for all the requests (Valid & Invalid). The Error Code and Message are sent in the body field. So It is impossible to know when a request is Invalid because it shows as success in the IO. So I want to throw an error whenever there is a response body with an error message & code. I have successfully accomplished it with a post-submit script (screenshot attached below). If anyone is facing the same challenge they can modify the script as per their needs and take a leaf from it.
Note: Also in the output filter they need to map (pause till some fix ths error).0
We have native fields in the import to support this use case. See following pic.0
Please sign in to leave a comment.