Add a survey via webhook
Generating an Add interaction webhook URL for a survey allows you to create new survey interactions via HTTP POST requests without requiring authentication. You can use this URL to generate new interactions from third-party apps or RESTful API clients. Mindful Feedback itself can use a webhook URL to generate interactions within an HTTP POST trigger event, as well.
In addition to the API capabilities, you can paste an Add interaction webhook URL directly into a web browser to open the New Survey Interaction form to manually generate and send new interactions.
Managing Webhook URLs
You can generate and access webhook URLs for individual surveys on the Surveys page. Quick access: Surveys > Your Survey > Advanced tab
|
Webhook URLs do not require authentication. This means the URL can be used by anyone. We recommend exercising caution when sharing the URL, since anyone can use it to generate new survey interactions for your organization.
If you are concerned that a webhook URL has been compromised, we recommend generating a new URL via the steps outlined above.
If possible, use IP Whitelists to only allow access from specified sources.
HTTP POST Requests
You can use the webhook URL to create a new survey interaction by performing an HTTP POST to the URL with a JSON object defining values for the required survey attributes.
For complete information on the attributes required to send with the POST, see the Add New Interaction API reference guide.
Example
The following example from a RESTful API client shows a sample request to and response from a webhook. Note that the Content-Type header should be set to application/json.
Browsing the Add Interaction Webhook URL
You can paste an Add interaction webhook URL into a web browser to load the New Survey Interaction form. This form will allow you to manually enter the attributes for a new survey interaction and schedule the interaction to be delivered to a customer. By default, the New Survey Interaction form will not have any values populated. However, you can append query string parameters to the end of a webhook URL to pre-fill the form for quick configuration. This can be useful if you wish to use the form to manually send surveys often with the same attributes. For more details and an example of using query string parameters, see the Add a Survey via the User Interface how-to guide. Important: Anyone accessing this form via webhook URL can send surveys on your behalf without being an authenticated user of your Mindful account.
|