General information and usage examples
Hook catcher is created for those cases when the webhook receives different record fields instead of static. In this case the hook trigger cannot map to a specific answer, but the trigger fields must be created. You can create several catchers, and connect a specific catcher to each trigger with the Webhook model.
Adding the catcher to the trigger, bundles with this trigger have a webhook catcher. The webhook catcher will offer Albato end-user to catch the test data on specified Webhook URL and create trigger fields.
There are two types of catchers. Simple type catches all the variables that come to the webhook and creates a field for each trigger. Adjustable catcher allows you to catch fields from a specific dataset/object. If the data arrives as a set of objects and each object has variables that indicate the name and the value of the object, you can create fields with the specified object names.
Name.The internal name of the catcher, which is displayed as part of the app settings.
Adjustable webhook catcher. A check mark indicates that the catcher will catch a certain type of field including additional fields at the bottom.
Path to the array of elements. Dataset/object mapping to catch the fields.
Name mapping: A mapping to a variable registered inside of an object's dataset containing names. This name will be used as the name of the field.
Value mapping: A mapping to a variable registered inside of an object's dataset containing value. This value will be passed to the trigger in the field.
The fields, except for the name, are optional. The more fields are filled, the more correct the catcher catches the fields.
If the data comes in JSON (simple form):
The field keys are always different, a simple catcher is created, without the “**Adjustable webhook catcher**” checkbox. Such catcher will catch all the fields and create a trigger field with the name equal to the name of the key in JSON
If some of the fields are static, and some are dynamic:
Put the check in the Adjustable Webhook Catcher box and enter the fields value in the `Path to the array of elements.`
The trigger will have three static created fields. Everything that comes in the fields is dynamic and the catcher will only catch fields from this object. Also, fields will be created for the number of variables, where the field name is equal to the name of the variable key.
In case of full dataset with name and value:
Put the check in the Adjustable Webhook Catcher box and enter answers in the Path to the array of elements field, in the Name mapping field enter title, and in the Value mapping field enter value.
The trigger will have a static set of three fields, the catcher will catch dataset for answers and create separate trigger field for each dataset. The name of the fields will be taken from title and the fields will transfer the value that will come in value.
The catcher setting is completed. Created catcher can be connected to the hook trigger.
Adding the catcher to the trigger, bundles with this trigger have a webhook catcher. The webhook catcher will offer Albato end-user to catch the test data on specified Webhook URL and create trigger fields.
There are two types of catchers. Simple type catches all the variables that come to the webhook and creates a field for each trigger. Adjustable catcher allows you to catch fields from a specific dataset/object. If the data arrives as a set of objects and each object has variables that indicate the name and the value of the object, you can create fields with the specified object names.
Fields of catcher
Name.The internal name of the catcher, which is displayed as part of the app settings.
Adjustable webhook catcher. A check mark indicates that the catcher will catch a certain type of field including additional fields at the bottom.
Path to the array of elements. Dataset/object mapping to catch the fields.
Name mapping: A mapping to a variable registered inside of an object's dataset containing names. This name will be used as the name of the field.
Value mapping: A mapping to a variable registered inside of an object's dataset containing value. This value will be passed to the trigger in the field.
The fields, except for the name, are optional. The more fields are filled, the more correct the catcher catches the fields.
Examples of using
If the data comes in JSON (simple form):
{"name":"name","phone":"79681112233","email":"email"}
The field keys are always different, a simple catcher is created, without the “**Adjustable webhook catcher**” checkbox. Such catcher will catch all the fields and create a trigger field with the name equal to the name of the key in JSON
If some of the fields are static, and some are dynamic:
{ "name":"name", "phone":"79681112233", "email":"email", "fields":{ "field1":"value1", "field2":"value2" }}
Put the check in the Adjustable Webhook Catcher box and enter the fields value in the `Path to the array of elements.`
The trigger will have three static created fields. Everything that comes in the fields is dynamic and the catcher will only catch fields from this object. Also, fields will be created for the number of variables, where the field name is equal to the name of the variable key.
In case of full dataset with name and value:
{ "name":"name", "phone":"79681112233", "email":"email", "answers": [ { "title":"Question 1", "value":"Answer 1" }, { "title":"Question 2", "value":"Answer 2" } ]}
Put the check in the Adjustable Webhook Catcher box and enter answers in the Path to the array of elements field, in the Name mapping field enter title, and in the Value mapping field enter value.
The trigger will have a static set of three fields, the catcher will catch dataset for answers and create separate trigger field for each dataset. The name of the fields will be taken from title and the fields will transfer the value that will come in value.
The catcher setting is completed. Created catcher can be connected to the hook trigger.
Updated on: 07/12/2022
Thank you!