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
          }
      }
  ]
}
Language
Credentials
OAuth2
URL
Click Try It! to start a request and see the response here!