A webhook in web development is a method of augmenting or altering the behavior of a web application, with custom callbacks. These callbacks may be maintained, modified, and managed by third-party users and developers who may not necessarily be affiliated with the originating application.
QuestionPro supports both incoming and outgoing webhooks. Webhooks can be invoked before the survey starts, during the survey (before or after a question) or after the survey is completed.Incoming Webhooks are a simple way to fetch the data from external sources into your survey.
Outgoing webhooks can be used to send survey data to an external source. They make use of normal HTTP requests with a JSON payload.
To create a webhook:
You can save the data retrieved from the external resource by mapping it to custom variables. To open up the mapping dialog box click on Add Custom Mapping buton:
You can map the data to custom variables by assigning individual JSON keys to specific custom variables. You can also assign a relevant name to the custom variables:
Once the mapping is set, the collected data can be displayed in the survey using the following code: ${DisplayName}
In case of outgoing webhooks you can send the data collected in custom variables to an external web service by adding the custom variables on the Request JSON:
To fetch the Custom Variables data you can use the following tags for the corresponding Custom Variables in the request JSON:
Custom Variable 1: ${custom1}
Custom Variable 2: ${custom2}
Custom Variable 3: ${custom3}
Custom Variable 4: ${custom4}
Custom Variable 5: ${custom5}
Custom Variable N: ${customN}
QuestionPro provides logs facility for each webhook where you can check the API details which was called by that webhook along with the payload and the response from the endpoint. To access the logs go to a particular webhook and scroll to the bottom of the page where you can view the requests made by that webhook and on clicking on the ID you can check the details of any specific call.
Also, if some outgoing calls failed to push the data, a Manual Retry button will be available in front of that API calls on which you can click anytime to push the data back to the API endpoint.