Survey123 Webhook only working in mobile app

596
4
Jump to solution
11-15-2019 10:18 AM
MaximilianVarwig
New Contributor II

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

0 Kudos
1 Solution

Accepted Solutions
MaximilianVarwig
New Contributor II

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

View solution in original post

4 Replies
ZhifangWang
Esri Regular Contributor

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

0 Kudos
MaximilianVarwig
New Contributor II

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

0 Kudos
MaximilianVarwig
New Contributor II

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.

0 Kudos
MaximilianVarwig
New Contributor II

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