Is the survey data attached to the webhook payload URL formatted in JSON? Is there an example of what it would look like?
I assume it looks like the following:
{"fields":
{
"Attribute1": value,
"Attribute2": value,
"Attribute3": value
}
}
Hi Mario,
We plan on providing formal documentation on the webhook payload in the future; it's a bit more complex and part of it will be dependent on the structure of the form as well. The easiest way to get a payload for your form is to register a webhook and observe the submission attempt in a browser's developer tools.
At a high level, the payload is a JSON object:
{ "eventType": "add"|"edit", "portalInfo": {}, "surveyInfo": {}, "userInfo": {}, "applyEdits": [], "response" : {}, "feature": {} }
The feature resource will be the most direct access point to the survey data, with a set of question:answer key/values.
I know this is an old post, but was formal documentation on the webhook payload ever developed? I'm trying to send a payload to my own server and parse it using PHP but the lack of documentation is making it difficult.
I am in the same boat. I need to know the format of the Survey123 webhook payload URL and I can't find any information on it. I'm trying to trigger an ArcGIS Server geoprocessing task using the webhook. I need to define it in ArcGIS Pro before I publish it to the server.
I second Ole Olmanson's request for a pointer to documentation. Thank you!
Thirded!Or if not documentation, then a way within a test survey to download the payload as a sample.
Trying to figure out if we can use the webhook function for a particular use case. since I couldn't find output examples online, I tried setting up a basic Slack App to receive the hook as a message just to see the output. Though the Slack hook is working for other messages, Slack isn't accepting this payload, which is maybe not surprising. But it suggests I need to stand up a web service just to receive the hook to see the payload to know if I can use a webservice for my use case. Gets a bit circular -- build the service to know if I can use the service....
I ended up using requestbin.com and setting up a public bin.
This gives you a url and monitors incoming posts.
Add the requestbin URL in your webhook.
Now you can fill out and submit your Survey123 form. The payload will be sent to the bin you created. Click on "post" and you can view the payload and use it to analyze the structure.
I hope this helps someone.