Webhook Request Mode

669
3
04-08-2020 11:47 PM
JürgenBiendara
Occasional Contributor

Hello

We have set up a survey that shall send the survey data via webhook to FME Server. FME Server does receive the request from Survey123 but not the data. Debugging the communication in the web browser shows that the request is sent with Request Mode "OPTIONS".

  • What effect does this parameter have and especially the OPTIONS value?
  • Is OPTIONS the correct setting for this parameter (or should it be GET)?
  • How can we change/influence the setting of this parameter in the SURVEY123 webhook configuration.

Thanks for any help, best regards.

Jürgen

Tags (1)
0 Kudos
3 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Jürgen,

The OPTIONS request is a standard pre-flight (pre-submission) request to check for CORS compatibilit... You should see that the data is not sent, but should be following in a following POST request.

0 Kudos
JorgeMonge
New Contributor

Same problem here. I have set up a webhook in Survey123. To test it, I created a webhook at https://webhook.site. When a new form is submitted, the webhook seems to be receiving just the OPTIONS request:

JorgeMonge_0-1613144168987.png


However, testing the same webhook with an online API testing tool (https://reqbin.com/) works fine, suggesting that the issue is from the source at Survey123 and not in the webhook:

JorgeMonge_1-1613144280373.png

 

JorgeMonge_2-1613144324312.png

 

0 Kudos
quillaja
New Contributor III

I was having a problem with the survey123 webhooks on a simple custom https server to test getting a notification from the survey. My endpoint was working just fine if I accessed it through the browser or postman, but always failed when submitting a survey123. My endpoint is nearly identical to the one shown in ESRI's own example on github: https://github.com/Esri/webhooks-samples/tree/master/Developer/python/flask

The only error message survey123 gave me was "failed to fetch". My endpoint also showed only an OPTIONS request and no POST as I was expecting.

Some searching led me to suspect CORS was the issue (in my experience it's always a CORS issue), so I added the header

 

Access-Control-Allow-Origin: *

 

with the same failed results. Further searching finally led me to the final headers

 

Access-Control-Allow-Origin: https://survey123.arcgis.com
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type

 

and my endpoint could finally receive the POST request and json data payload from the survey123 webhook.

ESRI's help about survey123 webhooks says nothing about requiring these headers to be included when responding to the webhook's OPTIONS request!

0 Kudos