What is Webhook?

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.

What are incoming webhooks?

Incoming Webhooks are a simple way to fetch the data from external sources into your survey.

What are outgoing webhooks?

Outgoing webhooks can be used to send survey data to an external source. They make use of normal HTTP requests with a JSON payload.

How to set up webhooks?

To create a webhook:

  • Go to: Survey >> Integrations >> Webhooks
  • Survey Software Help Image
  • Click on the Add New Webhook button.
  • Enter a description for your webhook
  • Select the required type (incoming / outgoing)
  • Choose when the webhook should be invoked.
  • Click on Save Changes
  • Survey Software Help Image
Once the webhook has been added, you’ll need to provide the data required to make the API call:
  • API URL: The endpoint URL for making an API call.
  • Method: The HTTP method used for making the call.
  • Request Header: HTTP header fields which are components of the header section of the request
  • Request JSON: Payload data required by the API. You can also use the Insert Response button to insert the response in the Request JSON.
Once you fill in the above details, click on the Save button.
Survey Software Help Image

How to use retrieved data from an incoming 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:

Survey Software Help Image

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:

Survey Software Help Image

Once the mapping is set, the collected data can be displayed in the survey using the following code: ${DisplayName}

How to provide data for an outgoing webhook?

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:

Survey Software Help Image

Data Replacement Variables

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}

To fetch data for survey questions, you can use the respective question code. For example, if you want to fetch data for a question with code Q1, you can use ${Q1}

How would I know whether the Webhook was executed successfully or failed?

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.

Survey Software Help Image

License & Access Options

This feature/tools described here are available with the following license(s) :

Enterprise Edition

Unlimited Surveys, Questions

Advanced Toolset and Features

No Long Term Commitment

Was this article helpful?
Sorry about that
How can we improve it?
Submit