Webhooks
What is a webhook?
Webhooks allow interaction between two applications and are triggered by an event. Let's take the example of Told; you can configure a webhook to retrieve the answers to a questionnaire and redirect them to Slack.
This is very useful if you want to automate tasks following your questionnaire answers. Without any knowledge of development, you can automate easily.
Here are some concrete cases you can do with webhooks:
- Send an email internally when a respondent completes your survey
- Send an email to respondents to offer them an interview, for example
- Redirect all the answers from your survey to Notion
- Redirect all survey responses to an Excel spreadsheet
- Redirect all survey responses to Slack
- What are the requirements for a webhook to work?
For a webhook to work properly, you need two things:
- An event that triggers the webhook (e.g., the user completes your survey)
- An http / https address on which you want to receive the data set
How to use no-code solutions like zapier and make with web-hooks?
There are several solutions to get your webhooks and automate workflows with them. The most known solution is Zappier, but there are other alternatives like IFTT or Make. We will use Make for the rest of the examples because it allows you to create workflows for free, unlike the other solutions mentioned above.
How to create a scenario on Make?
We will now see how to configure a scenario start and get an https address to redirect our webhooks from Told to Make.
- Click on the "Scenarios" tab
- Click on the "Create a new scenario" button
- Click on the big "+" button and select "Webhooks" from the dropdown menu (you can use the search bar at the bottom of the menu to find webhooks more easily).
- Click on "Custom webhook."
- Now, you need to add and set up your webhook; click on "Add," name it, and click on "Save."
- Congratulations 🎉 ! As you can see, Make gives you an HTTPS address to redirect your webhooks. Your webhook and now waiting for a dataset.
How to configure a webhook in Told?
Do you have an HTTPS address to redirect your data? So let's go; let's see how to configure a webhook on Told.
- Go to the configuration area of your survey
- Click on the Connection ⇒ Webhook tab
- Click on Add a webhook
- Set a name (no impact), fill in the URL waiting to receive your webhooks, and select the event that will trigger your webhook. Here is the list of triggers:
- Answer survey - a user completes and submits a survey.
- Answer - a user submits an answer to a specific question in a survey
- Answer NPS - a user submits an NPS answer
- Once you have set up your webhook, click Save
You've done it 🎉 ! Your automation solution should now receive your webhooks every time the chosen event is triggered.
Example Payloads for Each Event
Answer survey
A user completes and submits a survey.
Property | Type | Description |
---|---|---|
eventId | string | ID of the webhook |
eventType | “surveyFormAnswer” | Type of event |
createdAt | date/time | Date and time of the webhook creation |
data | array | Table with all the answers |
{
"eventId": "6399ad818654c700157cf29a",
"eventType": "surveyFormAnswer",
"createdAt": "2022-12-14T11:03:29.194Z",
"data": [
{
"id": "6399ad568654c700157cf14a",
"createdAt": "2022-12-14T11:02:46.574Z",
"kind": "SurveyAnswerChoice",
"question": {
"id": "6399a2a58654c700157cbdae",
"condition": false,
"content": "What is your favourite feature?",
"desc": "Description of the question",
"options": {
"mandatory": true,
"multiple": false,
"otherChoice": true,
"shuffle": false
},
"position": 0,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false
},
"kind": "SurveyQuestionChoice",
"choices": [
{
"id": "6399a2a58654c700157cbdb1",
"position": 0,
"otherChoice": false,
"content": "Feature n°1"
},
{
"id": "6399a2a58654c700157cbdb4",
"position": 1,
"otherChoice": false,
"content": "Feature n°2"
}
]
},
"choices": [
{
"id": "6399a2a58654c700157cbdb1",
"position": 0,
"otherChoice": false,
"content": "Feature n°1"
}
],
"author": {
"id": "639c3c221bf88007336128c8",
"name": "Tester #397",
"resultNPS": -1,
"tags": [],
"hasStarted": false,
"reachEnd": false,
"survey": "62d6b455f8b10b0076df2991",
"deviceType": "phone",
"hiddenFields": [
{
"_id": "639c3c221bf88007336128c9",
"key": "email",
"value": "[email protected]"
},
{
"_id": "639c3c221bf88007336128ca",
"key": "phoneNumber",
"value": "06666666"
}
],
"createdAt": "2022-12-16T09:36:34.104Z",
"updatedAt": "2022-12-16T09:36:34.121Z",
"__v": 0,
"currentQuestion": "639863a260400d074eb5cd14"
}
},
{
"id": "6399ad7a8654c700157cf18e",
"createdAt": "2022-12-14T11:03:22.241Z",
"content": "I love this feature, it's the one I use the most! It saves me time on data analysis.",
"kind": "SurveyAnswerText",
"question": {
"id": "6399a28b8654c700157cbd48",
"condition": false,
"content": "Why is this your favorite feature?",
"desc": "Description of the question",
"options": {
"mandatory": false
},
"position": 1,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false
},
"type": "text",
"kind": "SurveyQuestionOpen"
},
"author": {
"id": "639c3c221bf88007336128c8",
"name": "Tester #397",
"resultNPS": -1,
"tags": [],
"hasStarted": false,
"reachEnd": false,
"survey": "62d6b455f8b10b0076df2991",
"deviceType": "phone",
"hiddenFields": [
{
"_id": "639c3c221bf88007336128c9",
"key": "email",
"value": "[email protected]"
},
{
"_id": "639c3c221bf88007336128ca",
"key": "phoneNumber",
"value": "06666666"
}
],
"createdAt": "2022-12-16T09:36:34.104Z",
"updatedAt": "2022-12-16T09:36:34.121Z",
"__v": 0,
"currentQuestion": "639863a260400d074eb5cd14"
}
},
},
{
"id": "6399ad7c8654c700157cf1ce",
"createdAt": "2022-12-14T11:03:24.291Z",
"content": 4,
"kind": "SurveyAnswerNumber",
"question": {
"id": "6399a2c48654c700157cbe81",
"condition": false,
"content": "What is your feeling after your experience on our platform?",
"desc": "Description of the question",
"options": {
"mandatory": false,
"withLabels": false
},
"position": 2,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false
},
"stepLength": 5,
"labels": [],
"displayType": "emoji",
"kind": "SurveyQuestionOpinion"
},
"author": {
"id": "639c3c221bf88007336128c8",
"name": "Tester #397",
"resultNPS": -1,
"tags": [],
"hasStarted": false,
"reachEnd": false,
"survey": "62d6b455f8b10b0076df2991",
"deviceType": "phone",
"hiddenFields": [
{
"_id": "639c3c221bf88007336128c9",
"key": "email",
"value": "[email protected]"
},
{
"_id": "639c3c221bf88007336128ca",
"key": "phoneNumber",
"value": "06666666"
}
],
"createdAt": "2022-12-16T09:36:34.104Z",
"updatedAt": "2022-12-16T09:36:34.121Z",
"__v": 0,
"currentQuestion": "639863a260400d074eb5cd14"
}
},
},
{
"id": "6399ad7e8654c700157cf20e",
"createdAt": "2022-12-14T11:03:26.262Z",
"content": 10,
"kind": "SurveyAnswerNumber",
"question": {
"id": "6399a2d88654c700157cbedb",
"condition": false,
"content": "How likely are you to recommend our company to a friend or colleague?",
"desc": "Description of the question",
"options": {
"mandatory": false,
"withLabels": false
},
"position": 3,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false
},
"stepLength": 11,
"startAt": 0,
"labels": [
"",
"",
""
],
"goal": -1,
"kind": "SurveyQuestionNPS"
},
"author": {
"id": "639c3c221bf88007336128c8",
"name": "Tester #397",
"resultNPS": -1,
"tags": [],
"hasStarted": false,
"reachEnd": false,
"survey": "62d6b455f8b10b0076df2991",
"deviceType": "phone",
"hiddenFields": [
{
"_id": "639c3c221bf88007336128c9",
"key": "email",
"value": "[email protected]"
},
{
"_id": "639c3c221bf88007336128ca",
"key": "phoneNumber",
"value": "06666666"
}
],
"createdAt": "2022-12-16T09:36:34.104Z",
"updatedAt": "2022-12-16T09:36:34.121Z",
"__v": 0,
"currentQuestion": "639863a260400d074eb5cd14"
}
},
},
{
"id": "6399ad808654c700157cf250",
"createdAt": "2022-12-14T11:03:28.790Z",
"kind": "SurveyAnswerDefault",
"question": {
"id": "6399a2f48654c700157cbfa1",
"condition": false,
"content": "Click on the button to be redirected to google",
"desc": "Description of the question",
"options": {
"otherField": false
},
"button": {
"link": "<https://google.fr>",
"label": "Lien vers google",
"show": true
},
"color": "",
"position": 4,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false
},
"kind": "SurveyQuestionMessage"
},
"author": {
"id": "639c3c221bf88007336128c8",
"name": "Tester #397",
"resultNPS": -1,
"tags": [],
"hasStarted": false,
"reachEnd": false,
"survey": "62d6b455f8b10b0076df2991",
"deviceType": "phone",
"hiddenFields": [
{
"_id": "639c3c221bf88007336128c9",
"key": "email",
"value": "[email protected]"
},
{
"_id": "639c3c221bf88007336128ca",
"key": "phoneNumber",
"value": "06666666"
}
],
"createdAt": "2022-12-16T09:36:34.104Z",
"updatedAt": "2022-12-16T09:36:34.121Z",
"__v": 0,
"currentQuestion": "639863a260400d074eb5cd14"
}
},
}
]
}
Answer
A user submits an answer to a specific question in a survey.
Property | Type | Description |
---|---|---|
eventId | string | ID of the webhook |
eventType | “surveyAnswer” | Type of event |
createdAt | date/time | Date and time of the webhook creation |
data | object | Table with all the answers |
{
"eventId": "6399ad7a8654c700157cf1a2",
"eventType": "surveyAnswer",
"createdAt": "2022-12-14T11:03:22.310Z",
"data": {
"id": "6399ad7a8654c700157cf18e",
"createdAt": "2022-12-14T11:03:22.241Z",
"content": "I love this feature, it's the one I use the most! It saves me time on data analysis.",
"kind": "SurveyAnswerText",
"question": {
"id": "6399a28b8654c700157cbd48",
"condition": false,
"content": "Why is this your favorite feature?",
"desc": "Description of the question",
"options": {
"mandatory": false
},
"position": 1,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false
},
"type": "text",
"kind": "SurveyQuestionOpen"
},
"author": {
"id": "639c3c221bf88007336128c8",
"name": "Tester #397",
"resultNPS": -1,
"tags": [],
"hasStarted": false,
"reachEnd": false,
"survey": "62d6b455f8b10b0076df2991",
"deviceType": "phone",
"hiddenFields": [
{
"_id": "639c3c221bf88007336128c9",
"key": "email",
"value": "[email protected]"
},
{
"_id": "639c3c221bf88007336128ca",
"key": "phoneNumber",
"value": "06666666"
}
],
"createdAt": "2022-12-16T09:36:34.104Z",
"updatedAt": "2022-12-16T09:36:34.121Z",
"__v": 0,
"currentQuestion": "639863a260400d074eb5cd14"
}
},
}
}
Answer NPS
A user submits an NPS answer
Property | Type | Description |
---|---|---|
eventId | string | ID of the webhook |
eventType | "surveyNPSAnwser” | Type of the event |
createdAt | date/time | Date and time of the webhook creation |
data | object | Table with all the answers |
{
"eventId": "6399a9888654c700157cdf47",
"eventType": "surveyNPSAnswer",
"createdAt": "2022-12-14T10:46:32.610Z",
"data": {
"id": "6399a9888654c700157cdf33",
"createdAt": "2022-12-14T10:46:32.532Z",
"content": 9,
"kind": "SurveyAnswerNumber",
"question": {
"id": "6399a2d88654c700157cbedb",
"condition": false,
"content": "Ceci est le titre de la question nps",
"desc": "Ceci est la description de la question nps",
"options": {
"mandatory": false,
"withLabels": true
},
"position": 3,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false
},
"stepLength": 11,
"startAt": 0,
"labels": [
"Peu probable",
"",
"Très probable"
],
"goal": -1,
"kind": "SurveyQuestionNPS"
},
"author": {
"id": "639c3c221bf88007336128c8",
"name": "Tester #397",
"resultNPS": -1,
"tags": [],
"hasStarted": false,
"reachEnd": false,
"survey": "62d6b455f8b10b0076df2991",
"deviceType": "phone",
"hiddenFields": [
{
"_id": "639c3c221bf88007336128c9",
"key": "email",
"value": "[email protected]"
},
{
"_id": "639c3c221bf88007336128ca",
"key": "phoneNumber",
"value": "06666666"
}
],
"createdAt": "2022-12-16T09:36:34.104Z",
"updatedAt": "2022-12-16T09:36:34.121Z",
"__v": 0,
"currentQuestion": "639863a260400d074eb5cd14"
}
},
}
}
Example Payloads for Each Answer Type
NPS Question
Field | Description |
---|---|
id | Unique ID of the response. |
createdAt | Timestamp of when the response was created. |
content | Score provided by the user (0-10). |
kind | Type of response (SurveyAnswerNumber ). |
question | Details of the NPS question. |
author | ID of the user who provided the response. |
Example:
{
"id": "62a7003ef05082006900a089",
"createdAt": "2022-06-13T09:15:42.923Z",
"content": 9,
"kind": "SurveyAnswerNumber",
"question": {
"id": "62a6fd17f050820069009d93",
"condition": false,
"content": "How likely are you to recommend our product to a friend or colleague?",
"desc": "",
"options": {
"mandatory": false,
"withLabels": true},
"position": 0,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false},
"stepLength": 11,
"startAt": 0,
"labels": [
"Not likely at all",
"",
"Extremely likely"
],
"goal": -1,
"kind": "SurveyQuestionNPS"
},
"author": "62a7003ef05082006900a09b"
}
Multiple Choice Question
Field | Description |
---|---|
id | Unique ID of the response. |
createdAt | Timestamp of when the response was created. |
kind | Type of response (SurveyAnswerChoice ). |
question | Details of the multiple-choice question. |
choices | List of selected options. |
author | ID of the user who provided the response. |
Example:
{
"id": "62a70043f05082006900a0bc",
"createdAt": "2022-06-13T09:15:47.971Z",
"kind": "SurveyAnswerChoice",
"question": {
"id": "62a6fd09f050820069009d47",
"condition": false,
"content": "How much do you need the product?",
"desc": "",
"options": {
"mandatory": true,
"multiple": false,
"otherChoice": true,
"shuffle": false},
"position": 1,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false},
"kind": "SurveyQuestionChoice",
"choices": [
{
"id": "62a6fd09f050820069009d4a",
"position": 0,
"otherChoice": false,
"content": "Definitely need it"
},
{
"id": "62a6fd09f050820069009d4d",
"position": 1,
"otherChoice": false,
"content": "Kind of need it"
}
]
},
"choices": [
{
"id": "62a6fd09f050820069009d4d",
"position": 1,
"otherChoice": false,
"content": "Kind of need it"
}
],
"author": "62a7003ef05082006900a09b"
}
Message Question
Field | Description |
---|---|
id | Unique ID of the response. |
createdAt | Timestamp of when the response was created. |
kind | Type of response (SurveyAnswerDefault ). |
question | Details of the informational message. |
author | ID of the user who viewed the message. |
Example:
{
"id": "62a70045f05082006900a0e7",
"createdAt": "2022-06-13T09:15:49.794Z",
"kind": "SurveyAnswerDefault",
"question": {
"id": "62a6fd10f050820069009d66",
"condition": false,
"content": "OK, now we're going to show you a series of statements. Let us know how much you agree with each.",
"desc": "",
"options": {
"otherField": false},
"button": {
"show": false},
"color": "",
"position": 2,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false},
"kind": "SurveyQuestionMessage"
},
"author": "62a7003ef05082006900a09b"
}
Opinion Question
Field | Description |
---|---|
id | Unique ID of the response. |
createdAt | Timestamp of when the response was created. |
content | User's rating (1-5 or emoji scale). |
kind | Type of response (SurveyAnswerNumber ). |
question | Details of the opinion question. |
author | ID of the user who provided the response. |
Example:
{
"id": "62a70048f05082006900a110",
"createdAt": "2022-06-13T09:15:52.205Z",
"content": 3,
"kind": "SurveyAnswerNumber",
"question": {
"id": "62a6fd15f050820069009d84",
"condition": false,
"content": "What do you think of our product?",
"desc": "",
"options": {
"mandatory": false,
"withLabels": false},
"position": 3,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false},
"stepLength": 5,
"labels": [],
"displayType": "emoji",
"kind": "SurveyQuestionOpinion"
},
"author": "62a7003ef05082006900a09b"
}
Open Question
Field | Description |
---|---|
id | Unique ID of the response. |
createdAt | Timestamp of when the response was created. |
content | Text response provided by the user. |
kind | Type of response (SurveyAnswerText ). |
question | Details of the open-ended question. |
author | ID of the user who provided the response. |
Example:
{
"id": "62a70096f05082006900a139",
"createdAt": "2022-06-13T09:17:10.761Z",
"content": "I don't have any comment.",
"kind": "SurveyAnswerText",
"question": {
"id": "62a6fd12f050820069009d75",
"condition": false,
"content": "If you have some comments on any of these topics, we'd love to hear them.",
"desc": "",
"options": {
"mandatory": false},
"position": 4,
"media": {
"image": "",
"video": "",
"link": "",
"fit": false},
"type": "text",
"kind": "SurveyQuestionOpen"
},
"author": "62a7003ef05082006900a09b"
}