SalesBot widget block execution confirmation

The method receives data after successful execution of the widget block in SalesBot and continues the Bot workflow.

🚧

Limitations

  • The method is available for administrators of the account.
  • The maximum number of handlers that can be passed in the "execute_handlers" parameter is 10.
  • If a "show" handler is provided in "execute_handler", the value parameter must not exceed 80 characters.
  • The maximum number of buttons that can be passed in "execute_handler" is 25.

Request parameters

If the widget needs to pass any data, it should be put into the “data” field as an object.

If the widget needs to perform an action before the bot continues working, then you can pass a list of handlers to the parameter: "execute_handlers". The passed handlers are executed one by one.

An example of the request

In the following example, we’ll pass a “status” field to the widget. The widget will be able to get the field’s value (“success”) in any block after the "widget_request" by the {{json.status}} key. We will also tell the widget bot to display text, buttons, buttons with links and go to step 5 of the widget bot.

{
  "data": {
      "status": "success"
  },
  "execute_handlers": [
      {
          "handler": "show",
          "params": {
              "type": "text",
              "value": "Your text"
          }
      },
      {
          "handler": "show",
          "params": {
              "type": "buttons",
              "value": "Press the button",
              "buttons": [
                  "Button 1",
                  "Button 2",
                  "Button 3",
                  "Button 4",
                  ...
                  "Button 25"
              ]
          }
      },
      {
          "handler": "show",
          "params": {
              "type": "buttons_url",
              "value": "Buttons with links",
              "buttons": [
                  "https://kommo.com"
              ]
          }
      },
      {
          "handler": "goto",
          "params": {
              "type": "question|answer|finish",
              "step": 5
          }
      }
  ]
}
Path Params
int32
required

Bot ID

int32
required

Continue ID. The system passes it to the webhook

string
enum
required

Type of bot

Allowed:
Body Params
json

Data for widget. It can be acquired in the SalesBot code with the key {{json.OBJECT_KEY_NAME}}, where OBJECT_KEY_NAME is the name of the field passed into “data”

json

Currently the following types of handlers are supported: show, goto.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
OAuth2
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/html
application/json