div-patch

Edits the element.

Parameters

Parameters Description
changes

array

Required parameter.

Element changes.

An array must not be empty.

Available platforms: Android, iOS, web.

mode

string

Procedure for applying changes:

  • transactional — if an error occurs during application of at least one element, the changes aren't applied.
  • partial — all possible changes are applied. If there are errors, they are reported.
  • Possible values: transactional, partial.

    Default value: partial.

    Available platforms: Android, web.

    on_applied_actions

    array

    Actions to perform after changes are applied.

    Available platforms: Android, iOS, web.

    on_failed_actions

    array

    Actions to perform if there’s an error when applying changes in transaction mode.

    Available platforms: Android, web.

    change

    Parameters Description
    id

    string

    Required parameter.

    ID of an element to be replaced or removed.

    items

    array

    Elements to be inserted. If the parameter isn't specified, the element will be removed.

    List of possible values:

  • div-image
  • div-gif-image
  • div-text
  • div-separator
  • div-container
  • div-grid
  • div-gallery
  • div-pager
  • div-tabs
  • div-state
  • div-custom
  • div-indicator
  • div-slider
  • div-switch
  • div-input
  • div-select
  • div-video
  • JSON
    {
      changes*: [
        {
          id*: "string",
          items: [ div, ... ]
        },
        ...
      ],
      mode: "string",
      on_applied_actions: [
        {
          download_callbacks: {
            on_fail_actions: [ div-action, ... ],
            on_success_actions: [ div-action, ... ]
          },
          is_enabled: "bool_int",
          log_id*: "string",
          log_url: "string",
          menu_items: [
            {
              action: div-action,
              actions: [ div-action, ... ],
              text*: "string"
            },
            ...
          ],
          payload: "object",
          referer: "string",
          scope_id: "string",
          target: "string",
          typed: div-action-typed,
          url: "string"
        },
        ...
      ],
      on_failed_actions: [
        {
          download_callbacks: {
            on_fail_actions: [ div-action, ... ],
            on_success_actions: [ div-action, ... ]
          },
          is_enabled: "bool_int",
          log_id*: "string",
          log_url: "string",
          menu_items: [
            {
              action: div-action,
              actions: [ div-action, ... ],
              text*: "string"
            },
            ...
          ],
          payload: "object",
          referer: "string",
          scope_id: "string",
          target: "string",
          typed: div-action-typed,
          url: "string"
        },
        ...
      ]
    }