Allow Survey123 Webhook to POST form values for connecting a GP Service

319
1
10-23-2023 11:31 AM
Status: Closed
Labels (1)
FredSpataro
Occasional Contributor III

A Geoprocessing Service is an ideal candidate for a webhook handler since ArcGIS server implements the necessary web server endpoint and the scripting can easily access ArcGIS data and functions. 

However right now a GP service requires structured form values for each parameter in the POST body and won't pass thru the JSON body from the current webhook.   I've tried a few options and the webhook fires the GP Service without issue ie:

https://myserver.com/arcgis/rest/S123Handlers/GPServer/MyWebHookScript/execute

but the JSON data is never passed thru.  

A simple option 'POST as form values'  and either:

1. POST the entire json to a single named parameter (eg 'eventData')

2. POST each selected event data to it's own named parameter: SurveyInfo, UserInfo, etc.. 

 

If this was an option, then the GP script can easily be created to match the correct name(s) with string/text type and then parsed in the script.  

 

1 Comment
JamesTedrick
Status changed to: Closed

Hi @FredSpataro ,

We have previously researched this with the geoprocessing service team and determined this is more of an issue of a GP Service being able to accept the data in the format a webhook provides.  Webhooks by design generally emit only objects that are then processed by the receiver.  The same issue applies for feature service and portal item webhooks, for example.