Response
Set up the response parser in the Response tab for the completed HTTP request. The created fields will take values from the response and save them to the fields of the entity.
Unlike the Request tab, here in the right field select the displayed entity.
Content-type
Indicate the format of the request response to receive. Available options:
JSON
XML
urlEncoded
Specify the the request format in Response tab, as the request may be urlEncoded, and the response may be in JSON.
The response will be expected strictly in the selected format of the widget. If the response comes in a different format, parsing fails.
Use this field if the response contains data in an array of unlimited objects (for example, API triggers that make a request to get a list of entities).
If the data in the response comes in this form:
and you need to receive both objects, then put a check at a “Return data array” box. Specify the mapping to the array, in this case it is data. In the created fields, the mapping can be specified without a path to this array.
You can also check the box but leave the field empty, the data comes at the root of the array, for example:
Trigger with such setting, will be started as many times as there are objects in the response.
If you want to receive the headers value, add the fields in this tab. Indicate the key in each field on the left, select the entity field on the right to save the value. For example, when you need to get the header value:
specify the key dateTimeEvent in the left field, and select the field to save the value in the right:
Parameters
Add fields you want to get from the request body.
The mapping to the key of the variable you want to obtain is in the left field. The mapping rule is similar to Request. Select the entity field of the right field to save the received value.
The fields also have an additional checkbox Located in the array. This checkbox indicates that the variable is in the array specified in the Path to the data array field, and the mapping must be specified without the path to this array.
For example, if the answer is like this:
You can create three fields, specifying the path to the array. Left empty the field that catches ID value, and put the check for the rest fields:
As a result, the data will be received two times, each time the name and phone number will be unique, but ID will be the same from the root of the answer.
If the field is either DateTime or Phone type, then it will have an additional setting gear. These fields are optional. If you leave it empty, the phone number will have the format of the send system and the date will be automatically converted to the Y-m-d H:i:s format. Select the date format in case it is off standard.
Unlike the Request tab, here in the right field select the displayed entity.
Content-type
Indicate the format of the request response to receive. Available options:
JSON
XML
urlEncoded
Specify the the request format in Response tab, as the request may be urlEncoded, and the response may be in JSON.
The response will be expected strictly in the selected format of the widget. If the response comes in a different format, parsing fails.
The path to the Array
Use this field if the response contains data in an array of unlimited objects (for example, API triggers that make a request to get a list of entities).
If the data in the response comes in this form:
{
"data":[
{
"name":"Mike",
"phone":"+19681112233"
}
{
"name":"Vasiliy",
"phone":"+19681112244"
}
]
}
and you need to receive both objects, then put a check at a “Return data array” box. Specify the mapping to the array, in this case it is data. In the created fields, the mapping can be specified without a path to this array.
You can also check the box but leave the field empty, the data comes at the root of the array, for example:
[
{
"name":"Mike",
"phone":"+19681112233"
}
{
"name":"Vasiliy",
"phone":"+19681112244"
}
]
Trigger with such setting, will be started as many times as there are objects in the response.
Headers
If you want to receive the headers value, add the fields in this tab. Indicate the key in each field on the left, select the entity field on the right to save the value. For example, when you need to get the header value:
-H "dateTimeEvent: 2021-08-09 19:00:00"
specify the key dateTimeEvent in the left field, and select the field to save the value in the right:
Parameters
Add fields you want to get from the request body.
The mapping to the key of the variable you want to obtain is in the left field. The mapping rule is similar to Request. Select the entity field of the right field to save the received value.
The fields also have an additional checkbox Located in the array. This checkbox indicates that the variable is in the array specified in the Path to the data array field, and the mapping must be specified without the path to this array.
For example, if the answer is like this:
{
"id": 12345,
"data":[
{
"name":"Mike
",
"phone":"+19681112233"
}
{
"name":"John",
"phone":"+19681112244"
}
]
}
You can create three fields, specifying the path to the array. Left empty the field that catches ID value, and put the check for the rest fields:
As a result, the data will be received two times, each time the name and phone number will be unique, but ID will be the same from the root of the answer.
If the field is either DateTime or Phone type, then it will have an additional setting gear. These fields are optional. If you leave it empty, the phone number will have the format of the send system and the date will be automatically converted to the Y-m-d H:i:s format. Select the date format in case it is off standard.
Updated on: 18/01/2024
Thank you!