Action requests
Create Requests widget in the “Requests” tab indicating URL to transfer data. It is possible to create several widgets that will perform requests sequentially. If you create an uneditable field in the first widget in the Response tab and set the value, it can be used in the Request tab in the next widget (next request) substituting the value obtained from the request.
First create the fields, then create the widget with URL, select the method, content-type and link created Authorization (to substitute the authorization data in the request).After add the necessary fields in the “Headers” and “Parameters” tabs, prescribing the mapping of variables and indicating which field of action will fall into this variable.
For example, we have created two fields Deal Name and Deal Budget, then we need to send an HTTP request to the app of the following form:
For this request we need to create two fields in the “Parameters” tab. Next step is to specify JSON key mapping in the left field, select the created action fields from the “Entity fields” list, and select the field’s type to pass it in the HTTP request. Follow this link to read about ow to specify mapping.
Let’s suppose that after creating a deal, the ID of this deal is also returned in response.
To get it, you need to create a “response field” (dоn’t put a check on “Editable” box) and set up the Response tab for the widget by mapping the request field we need.
For example, we get JSON in the following form:
You need to create one field, enter the mapping ID on the left and select the action on the right to save the ID.
An action with response can perform only with one entity. If you create a search action, only one entity can be returned in response. The “path to the data array” will ease the mapping setup, but will not start the action several times for each object, as triggers do.
If this tab is not set up for action, all requests will be considered as successful. To prevent this, set up the tab according to this.
First create the fields, then create the widget with URL, select the method, content-type and link created Authorization (to substitute the authorization data in the request).After add the necessary fields in the “Headers” and “Parameters” tabs, prescribing the mapping of variables and indicating which field of action will fall into this variable.
Request
For example, we have created two fields Deal Name and Deal Budget, then we need to send an HTTP request to the app of the following form:
{ "title":"Deal name", "budjet": 1000}
For this request we need to create two fields in the “Parameters” tab. Next step is to specify JSON key mapping in the left field, select the created action fields from the “Entity fields” list, and select the field’s type to pass it in the HTTP request. Follow this link to read about ow to specify mapping.
Response
Let’s suppose that after creating a deal, the ID of this deal is also returned in response.
To get it, you need to create a “response field” (dоn’t put a check on “Editable” box) and set up the Response tab for the widget by mapping the request field we need.
For example, we get JSON in the following form:
{"result":"OK","id": 123}
You need to create one field, enter the mapping ID on the left and select the action on the right to save the ID.
An action with response can perform only with one entity. If you create a search action, only one entity can be returned in response. The “path to the data array” will ease the mapping setup, but will not start the action several times for each object, as triggers do.
Errors
If this tab is not set up for action, all requests will be considered as successful. To prevent this, set up the tab according to this.
Updated on: 07/12/2022
Thank you!