Widget as a Link with Slider REST_APP_URI

Scope: placement

This integration does not have a separate, pre-defined button in the interface that allows the user to open it independently. The application can simply send a link of a special format to any Bitrix24 tool that supports adding content with links:

  • Messages and comments in the news feed;
  • Messages in internal group and individual chats (will not work in open channel dialogs);
  • Task descriptions and comments;
  • Calendar meeting descriptions;
  • Etc.

To use this integration, the link must be in the format /marketplace/view/#APP_CODE#/, where #APP_CODE#:

  • The symbolic code of your mass-market application from the Developer's area, which is set in the application card;
  • The client_id of the local application (for example, local.66ba434d853c87.18550109), which can be copied from the application settings in the Developer resources section.

The integration can accept any number of arbitrary parameters in the GET key params, for example: /marketplace/view/#APP_CODE#/?params[test]=y. In this case, PLACEMENT_OPTIONS will be as follows:

[PLACEMENT_OPTIONS] => {"test":"y"}
        

The widget code is specified in the PLACEMENT parameter of the placement.bind method.

The integration will not be displayed in the interface until the application installation is complete. Check the application installation

Where the Widget is Integrated

Widget Code

Location

REST_APP_URI

The specific integration location is not indicated at the stage of adding the widget handler, as the widget will open when clicking on any links of the special format described above

What the Handler Receives

Data is transmitted as a POST request

Array
        (
            [DOMAIN] => xxx.bitrix24.com
            [PROTOCOL] => 1
            [LANG] => en
            [APP_SID] => 195ec4ee87932d8f9bbbd6a2f0a83553
            [AUTH_ID] => f27bbb6600705a0700005a4b00000001f0f107398c3f17f5fc48d5ce194d5c65de7cfb
            [AUTH_EXPIRES] => 3600
            [REFRESH_ID] => e2fae26600705a0700005a4b00000001f0f1075f986dbd8dff24c36c2ad9bb0816a665
            [member_id] => da45a03b265edd8787f8a258d793cc5d
            [status] => L
            [PLACEMENT] => REST_APP_URI
            [PLACEMENT_OPTIONS] => {"test":"y"}
        )
        

Required parameters are marked with *

Parameter
type

Description

DOMAIN*
string

The Bitrix24 address where the widget handler was invoked

PROTOCOL*
string

Secure or non-secure HTTP protocol:

  • 0 - HTTP
  • 1 - HTTPS

LANG*
string

The user interface language of Bitrix24 that invoked the widget. You can localize the interface language in your widget based on this value

APP_SID
string

String identifier of the application that registered the widget handler

AUTH_ID
string

Authorization token OAuth 2 issued for the user who invoked the widget. Can be used for REST API calls on behalf of this user

AUTH_EXPIRES
integer

Time in seconds after which the authorization token will become invalid

REFRESH_ID
string

Refresh token OAuth 2 issued for the user who invoked the widget. Can be used to refresh the authorization token on behalf of this user

member_id*
string

Unique string identifier of Bitrix24 where the widget handler was invoked.

status
string

Type of application that registered the handler for this widget. Accepts values:

PLACEMENT*
string

Code for the widget embedding location. You can use the same handler URL for all your widgets. The value that Bitrix24 will report in the PLACEMENT parameter will help determine from which specific widget embedding location your handler was invoked in each case

PLACEMENT_OPTIONS
string

Additional data in the form of a JSON string that defines the context of the widget execution. For example, this could be an array containing the numeric identifier of the CRM entity in the detail form where the widget handler was invoked, etc. The PLACEMENT_OPTIONS parameter, along with the PLACEMENT parameter, allows you to accurately determine for which specific widget embedding location and object the widget handler was invoked.

PLACEMENT_OPTIONS

The value of PLACEMENT_OPTIONS is a JSON string containing an array of one or more keys that were specified in the params parameter of the specific link, as described above.

This means that by setting in your links and processing the received GET parameter params in the widget handler, you can implement any necessary business logic.

Typical use-cases and scenarios

Continue Learning