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 a question) or after the survey is completed. You can set up webhooks from the Integrations >> Webhooks section:

Survey Software Help Image

What are incoming webhooks?

Incoming Webhooks are a simple way to post messages 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:

  • 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
Once you save the above information, QuestionPro will make a call to the specified API and display the response:
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:

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: ${KEY}

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}

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?