What are Webhooks?

A webhook is an event or a notification that's being sent from one location to the other when an action occurs. For QuestionScout, the event that will trigger the webhook is a submission in one of our forms. When a submission is stored, a notification containing the response data is being sent straight to your chosen destination - the webhook URL which you configure in the form settings.

Webhook notifications are sent via HTTP POST request, and the request body is in JSON format.

This is an example of what the request body in JSON looks like:

<code>{<br>  formId: '5d865f7e6c52467a966e1986',<br>  eventType: 'newSubmission',<br>  submittedAt: '2019-10-01T17:48:45.449Z',<br>  completionTime: 142,<br>  number: 19,<br>  ip: '0:0:0:0',<br>  submissionId: '5d93917d8c26ff6060bf80eb',<br>  formName: 'Webhook Example',<br>  "urlParams": [<br>    {<br>      "key": "userid",<br>      "value": "12345"<br>    },<br>    {<br>      "key": "type",<br>      "value": "web"<br>    }<br>  ],<br>  fields:<br>    [{<br>      name: 'Long Answer',<br>      id: '5d865fbc6c52467a966e198a',<br>      type: 'longText',<br>      value: 'Lorem ipsum dol'<br>    },<br>    {<br>      name: 'Number',<br>      id: '5d865fc16c52467a966e198b',<br>      type: 'shortText',<br>      value: 1<br>    },<br>    {<br>      name: 'Short Answer',<br>      id: '5d93700f55a8ca59d5dbc21d',<br>      type: 'shortText',<br>      value: 'Lorem ipsum'<br>    },<br>    {<br>      name: 'Number',<br>      id: '5d93701455a8ca59d5dbc21e',<br>      type: 'shortText',<br>      value: 2<br>    }]<br>}

How to set up Webhooks

To set up Webhooks on your form, you need to open the form you would like to enable Webhooks on, and go to the Settings tab. 

For this example, we use Webhook.site to see if the Webhook is coming through correctly.

On the form settings tab, you will find an area to put in your Webhooks at the bottom of the page.

Clicking "Add a Webhook" will open a model where you can enter your endpoint.

When you've entered the endpoint for the Webhook, clicking "Add Webhook" will show you the POST + Endpoint on the form settings tab.

That's all to it when adding Webhooks to your QuestionScout form.

Still need help? Contact Us Contact Us