The Server Request block allows the bot to communicate with an external or internal system via API. The robot can search/get client information and save new data obtained during the dialogue. The block also allows using network services via API, such as a calculator, unit converter, weather forecast, and others.
For example, an incoming call comes from the client. The robot determines the number and contacts the CRM system to obtain data. Knowing that the client has an active order, it asks if they are interested in the status. If the answer is positive, it provides information about the order before the client states the purpose of the call.
The block cannot be the last in the scenario, there must be at least an arrow to an empty block.
| Property | Description | |||
¶ Common |
||||
¶ General |
||||
| Label | The block name displayed in the scenario editor block, but not used in the dialogue with the client. It serves for the convenience of the user creating the scenario. | |||
| Marker | A conditional designation of the block, arbitrary text. It can be used in analytics in reports as a block passage marker – it allows tracking which blocks the robot has passed. | |||
| Message | The text that will be reproduced by the robot after transitioning to the block. It is displayed in the block in the scenario editor if no Label is set, and also appears as a tooltip when hovering over the block. | |||
| Delay | The period after which the message will be sent after transitioning to the block. With the delay before sending, you can emulate message typing – as if a real person is communicating with the client, not a bot. Set in seconds.
|
|||
| Send immediately | Allows sending messages before fully forming the queue in conjunction with the server request block. | |||
| Maximum wating time | The maximum wait time for a response from the server (in seconds), after which the response is considered not received. The minimum value is 0, the maximum is 300. If there were no Question blocks before the Request block, this value is ignored, and the wait for a response from the server will last no more than 5 seconds. | |||
| Wait message delay | The time in seconds after which the robot will play the repeated message until a response is received from the server. The message is filled in below in the field Wait more message field. | |||
| Wait more message | Phrases with a request to wait, which are voiced by the robot one at a time if no response is received or cannot be processed. Each phrase must be entered or added in a separate field. These phrases can be used to fill a pause during which the system performs an API call to a third-party service or CRM system. | |||
¶ Request |
||||
| Method |
The way the client (e.g., a web browser) interacts with the server.
|
|||
| URL | The address of the page to which the request is sent, representing the main request parameter. This address is tied to the page with which the robot interacts, and allows using variables in the address string to pass information to the service, ensuring effective interaction between the robot and the service. | |||
¶ Parameters |
||||
| Key |
A string that identifies a specific parameter. The key is usually a name or label that describes what exactly is being passed in the request. To add a key, click Add, to delete, click |
|||
| Value | The specific value associated with the key. The value represents the data that is passed in the request and corresponds to the specified key. | |||
¶ Authorization |
||||
| Authorization Type |
The type of authorization in the server request:
The set of the following fillable fields is determined after specifying the type of authorization. |
|||
¶ cURLAllows you to import and export queries in cURL format. When inserting a full cURL query into the text field of the cURL tab, all parameters such as method, URL, headers and request body are automatically recognized and transferred to the corresponding editor tabs (Method, URL, Parameters, Authorization, Headers, Request body). If you manually configure the request parameters on other tabs (for example, Parameters, Authorization), the cURL code is automatically generated on the cURL tab. This makes it easy to copy a query in cURL format for later use on the command line or other cURL-enabled tools. |
||||
¶ RecordsAllows you to attach audio files to a script block if Audio mode — Audio recordings is selected in the Settings block. |
||||
| Add record | Allows you to select a voice file from the list. To load a new file, press To change the file name, hover over the file name and click To remove an unwanted audio file from the voiceover, press |
|||
| Property | Description | ||
| Label | The name of the arrow that appears above the arrow in the scenario editor. | ||
| Output Data Type |
Decision type. Transition to the next scenario block occurs when a specific request result is achieved (successful or unsuccessful) or by default. The following fields will be displayed depending on the selected type. If no label is set for the arrow and it is the default arrow, the arrow will be named "Default". |
||
| Default | This type is used to transition to a branch if the conditions in all other arrows of this block are not met. No additional parameter settings are required. | ||
| Successful Response | The transition to the branch will occur if the server response is successful. | ||
| Response Code | The successful response code that the system will expect after the request is executed. For example, 200, 201. All response codes are considered successful, even 500 and 404. The response is considered unsuccessful if it was not received at all. | ||
| Conditions |
A set of conditions by which a decision is made. The transition to the branch will occur if the server response code matches the one specified in the arrow properties and the specified conditions are met. The server response result will be saved in the The following fields are filled for conditions:
|
||
| Variables |
Each variable is added in a separate field by clicking the Add button and removed by clicking on In the Name and Response Field fields, the names and values of the variables are specified. In variable names it is allowed to use: Cyrillic letters, Latin letters, digits, dot (.), underscore (_), hyphen (-), square brackets ([]). Space is not recommended. To extract data from the server response, use the |
||
| Error | The transition to the branch will occur if the server response could not be obtained. No additional parameter settings are required. | ||