Hello,
I'm struggling to get a Survey123 webhook to work properly. The URL of the webhook leads to a self-written script that is accessible in the internet. It works just fine if I submit the survey123 form via the mobile app.
However, the webhook is not executed when I am submitting the form using a web browser. This was tested on multiple devices (desktop PCs and mobile devices) and also different forms. I can't figure out why this happens.
I submitted the form on the same device with a browser and with the app and got the described result. If I manually paste the URL in a browser, the webhook works fine as well.
Does somebody have an idea for the reason of this behavior? Any help is greatly appreciated!
Regards,
Maximilian
Solved! Go to Solution.
Finally got it to work. OPTION request was not answered by our webserver, had to set a CORS rule specifically allowing OPTIONS requests from survey123.arcgis.com
Hi Maximilian,
Can you please try to identify if there is any issue in the browser after clicking the Submit button (which triggers the applyEdits request to the feature service) by using the browser's developer tools? You can get the most useful information there. For example in the following screenshot, there is a POST request failed and marked as red color since the webhook set in Integromat no longer exists.
Thanks,
Zhifang
Hi Zhifang,
thank you for your answer. The request gets sent successfully, status 200. The method however is OPTIONS. It looks like the webhook is executed correctly and that the error must be on my end. But I can't find the issue, and as I said it works when I am using the app.
Regards,
Maximilian
Didn't mention/see that there is no POST Request at all to our webserver when submitting with a browser, only the OPTIONS request. What is the reason for that? If the survey is submitted with the app, our webserver receives a POST Request and answers it.
Finally got it to work. OPTION request was not answered by our webserver, had to set a CORS rule specifically allowing OPTIONS requests from survey123.arcgis.com