Application Embedding
Developer of applications for Bitrix24 Marketplace can access a simple mechanism of embedding an application into Bitrix24 interface. This section provides reference information on embedding methods and locations.
Embedded applications, unavailable to a user, will not be displayed in lists, menu items or other locations where applications can be visible. Exception - embedding via the type of custom user field. However, authorization will not be passed to the frame and the developer of an app should take this into account.
The following locations are available for embedding:
CRM scope | |
---|---|
Code | Leads |
CRM_LEAD_LIST_MENU | List menu for Leads |
CRM_LEAD_DETAIL_TAB | Upper menu item in the Lead details tab |
CRM_LEAD_DETAIL_ACTIVITY | Timeline menu item for Leads |
CRM_LEAD_DETAIL_TOOLBAR | App list item in Lead details |
Code | Deals |
CRM_DEAL_LIST_MENU | Deals list menu |
CRM_DEAL_DETAIL_TAB | Upper menu item in the Deals details |
CRM_DEAL_DETAIL_ACTIVITY | Deal activity menu item |
CRM_DEAL_DETAIL_TOOLBAR | App list item inside deal details. |
Code | Contacts |
CRM_CONTACT_LIST_MENU | Contact list menu |
CRM_CONTACT_DETAIL_TAB | Upper menu item in the Contact details |
CRM_CONTACT_DETAIL_ACTIVITY | Contact activity menu item |
CRM_CONTACT_DETAIL_TOOLBAR | App list item in the Contact details |
Code | Companies |
CRM_COMPANY_LIST_MENU | Company list menu |
CRM_COMPANY_DETAIL_TAB | Upper menu item in the Company details |
CRM_COMPANY_DETAIL_ACTIVITY | Company activity menu item |
CRM_COMPANY_DETAIL_TOOLBAR | App list item in the Company details. |
Code | Invoices |
CRM_INVOICE_LIST_MENU | Invoices list menu |
Code | Estimates |
CRM_QUOTE_LIST_MENU | Estimate list context menu |
Code | Activities |
CRM_ACTIVITY_LIST_MENU | Activities list context menu |
Code | CRM Analytics |
CRM_ANALYTICS_MENU | CRM Analytics menu |
Code | Smart process automation |
Codes are equivalent to codes for any CRM entities. You only need to add DYNAMIC. Example: CRM_DYNAMIC_185_LIST_MENU CRM_DYNAMIC_185_DETAIL_TAB CRM_DYNAMIC_185_DETAIL_ACTIVITY |
185 - specific entity ID. | scope intranet |
Code | Knowledge Base embedding |
CRM | |
CRM_FUNNELS_TOOLBAR | Button in the Sales Funnel dropdown menu |
CRM_ANALYTICS_TOOLBAR | Option in cogwheel dropdown menu of CRM Analytics |
CRM_*_LIST_TOOLBAR | Option in Automation Rules dropdown menu. Available objects: DEAL, LEAD, CONTACT, COMPANY, INVOICE, ESTIMATE. |
CRM_*_DETAIL_TOOLBAR | Button at the upper section of CRM details. You must pass current object ID in placement_options. Available objects: DEAL, LEAD, CONTACT, COMPANY, INVOICE, ESTIMATE |
CRM_*_ACTIVITY_TIMELINE_MENU | Button in the object context menu (Only for objects DEAL, LEAD). You must pass current object ID in placement_options. |
CRM_*_DOCUMENTGENERATOR_BUTTON | Button in documents. You must pass current object ID in placement_options. Available objects: DEAL, LEAD, CONTACT, COMPANY, INVOICE, ESTIMATE |
CRM_*_ROBOT_DESIGNER_TOOLBAR | Option in cogwheel dropdown menu with automation rules (Only for objects DEAL, LEAD). |
Tasks | |
TASK_USER_LIST_TOOLBAR | Option in Automation Rules dropdown menu. You must pass user ID in placement_options. |
TASK_GROUP_LIST_TOOLBAR | Option in Automation Rules dropdown menu. You must pass workgroup ID in placement_options. |
TASK_ROBOT_DESIGNER_TOOLBAR | Option in cogwheel dropdown menu with automation rule. |
Workgroups | |
SONET_GROUP_ROBOT_DESIGNER_TOOLBAR | Option in Automation Rules dropdown menu in workgroup. You must pass current workgroup ID in placement_options. |
SONET_GROUP_TOOLBAR | Option in Automation Rules dropdown menu inside workgroup. You must pass current workgroup ID in placement_options. |
User profile | |
USER_PROFILE_MENU | Option with dropdown selection in the upper Bitrix24 account main menu. You must pass current user ID in placement_options. |
USER_PROFILE_TOOLBAR | Option in dropdown menu inside user profile. You must pass current user ID in placement_options. |
Telephony scope | |
Code | Call Card |
CALL_CARD | Call ID screen |
Code | Call statistics |
TELEPHONY_ANALYTICS_MENU | Call statistics menu |
Landing Scope | |
Code | Settings |
LANDING_SETTINGS | Settings menu (for Landing Page / Site) |
Code | Edit |
LANDING_BLOCK | Edit option for any block. |
Workgroups scope | |
Code | Settings |
SONET_GROUP_DETAIL_TAB | Workgroup detail tab. |
scope task | |
Code | Settings |
TASK_LIST_CONTEXT_MENU | Task list context menu. |
TASK_VIEW_TAB | New tab when viewing task |
TASK_VIEW_SIDEBAR | New side bar when viewing task |
TASK_VIEW_TOP_PANEL | Top panel when viewing task |
Calendar scope | |
Code | Settings |
CALENDAR_GRIDVIEW | List of calendar grid views |
Contact_Center scope | |
Code | Settings |
CONTACT_CENTER | Square tile in the list of Contact Center. |
scope im | |
code | Application in new chat design |
IM_NAVIGATION | Application for the left navigation menu (essentially, an application inside chat environment without embedding the app directly into the chat). |
IM_TEXTAREA | Application for panel above input field (generates content at the moment of message writing). |
IM_SIDEBAR | Application for sidebar (you can create applications that add additional scenarios for chat. For example, for separate drive for chat or a knowledge base). |
IM_CONTEXT_MENU | Application for opening a context menu for message inside chat, embedding into the item "Create using" (similar to "Create task” or "Create meeting" based on a message). |
IM_SMILES_SELECTOR | Application for expanding smileys and giphy features (can contain custom sources for images or smileys). |
Arbitrary location | |
Code | Settings |
REST_APP_URI | Each application on any Bitrix24 account is permitted to register only one embedding via placement.bind in any arbitrary location (Instant Messenger, Feed and etc.).
This embedding does not have an UI button that user can use to manually open the app. The app can send a link, leading to its embedding to any location (Instant Messenger, Feed and etc.). To use this embedding option, the link must have the format /marketplace/view/#APP_CODE#/, where The embedding can receive any number of parameters in the "get" key params, for example: /marketplace/view/#APP_CODE#/?params[test]=y. In this case, PLACEMENT_OPTIONS is as follows: [ 'test' = 'y' ]Example: using BBCode to insert this link into a chat: [url=/marketplace/view/'.$myApp['CODE'].'/?params[test]=y]uri[/url] <? $placement = 'REST_APP_URI'; $url = 'https://example.com/placement.php'; CRest::call( 'placement.bind', [ 'PLACEMENT' => $placement, 'HANDLER' => $url ] ); ?> The example above registers an embedding location on your portal. It can be registered only once on the portal for this PLACEMENT, and it becomes available for calling. You can place your embedding in your application: <a href="/marketplace/view/<?=$myApp['CODE']?>/">uri</a> And place it in a Feed post: <? CRest::call('log.blogpost.add', [ 'POST_TITLE' => 'Post Title', 'POST_MESSAGE' => 'use this [url=/marketplace/view/'.$myApp['CODE'].'/?params[test]=y]uri[/url]', 'DEST' => [ 'EN' ] ]); ?> Send it via bot to chat for a user via the method: <? CRest::call( 'imbot.message.add', [ 'DIALOG_ID' => 1, 'MESSAGE' => 'use this [url=/marketplace/view/'.$myApp['CODE'].'/?params[test]=y]uri[/url]', ] ); ?>
The link can be embedded in any text field which supports BBCode or inside your other embedding locations as a standard link. The GET parameter params can be used to modify the displayed parameters in the embedding. You can use this option in any various scenarios by passing any number of parameters into GET key params, for example: |
PAGE_BACKGROUND_WORKER |
Each account/portal allows for each individual application to register only a single embedding using the method placement.bind.
Registration example: CRest::call( 'placement.bind', [ 'PLACEMENT' => 'PAGE_BACKGROUND_WORKER', 'HANDLER' => 'http://portal.johns.bx/johns/placement/?ty=1', 'OPTIONS' => [ 'errorHandlerUrl' => 'http://portal.johns.bx/johns/logg.php?ty=1', ], 'LANG_ALL' => [ 'en' => [ 'TITLE' => 'test', ] ] ] ); This embedding location supports:
special JS methods and events for embedding a third-party WebRTC client. Learn more here. |
standard scope for placement embeddings | |
Code | Menu |
LEFT_MENU | Left menu |