Embedding Knowledge bases
Description
Bitrix24 interface has embedding locations for knowledge bases by the user . This chapter provides details on how to handle such embedding locations in terms of REST. Please note, it doesn't describe specific embedding locations, as overviewed here. This chapter focuses exclusively on knowledge bases from interface perspective.
First, determine a menu that you want to embed a knowledge base, and retrieve its code. It can be done by opening embedding selection menu in the interface ("Select Knowledge Base") and by viewing opened frame address. For example, it will contain the parameter menuId=crm_switcher:deal
. It is the co-called menu code.
Menu embedding and deleting
Menu embedding
Method landing.site.bindingToMenu binds Knowledge Base to the specified menu. Knowledge Base must have Read access permission.
Parameters
Parameter | Description | Available from version |
---|---|---|
id | Knowledge base ID. | |
menuCode | Menu character code, as defined above. |
Example
BX24.callMethod( 'landing.site.bindingToMenu', { id: 31, menuCode: 'crm_switcher:deal' }, function(result) { if(result.error()) { console.error(result.error()); } else { console.info(result.data()); } } );
Deleting from menu
Method landing.site.unbindingFromMenu deletes Knowledge base binding to the menu. Кnowledge Base must have Read access permission.
Parameters
Parameter | Description | Available from version |
---|---|---|
id | Knowledge base ID. | |
menuCode | Menu character code, as defined above. |
Example
BX24.callMethod( 'landing.site.unbindingFromMenu', { id: 31, menuCode: 'crm_switcher:deal' }, function(result) { if(result.error()) { console.error(result.error()); } else { console.info(result.data()); } } );
Menu bindings
Getting list of menu bindings
Method landing.site.getMenuBindings returns list of knowledge bases (all or specific ones), bound to the menu. Returns only bindings, to Knowledge Bases with Read access by current user.
Parameters
Parameter | Description | Available from version |
---|---|---|
menuCode | Menu character code as defined above. Optional, returns all bindings by default. |
Example
BX24.callMethod( 'landing.site.getMenuBindings', { menuCode: 'crm_switcher:deal' }, function(result) { if(result.error()) { console.error(result.error()); } else { console.info(result.data()); } } );
Binding to social network group
Method landing.site.bindingToGroup binds specific Knowledge base to a group. User must be a member of the specified group and this group must not have a bound Knowledge Base.
Parameters
Parameter | Description | Version |
---|---|---|
id | Knowledge Base ID. | |
groupId | Group ID. |
Example
BX24.callMethod( 'landing.site.bindingToGroup', { id: 32, groupId: 174 }, function(result) { if(result.error()) { console.error(result.error()); } else { console.info(result.data()); } } );
Deleting binding to social network group
Method landing.site.unbindingFromGroup unbinds specific Knowledge Base from group. User must be a member of specified group.
Parameters
Parameter | Description | Available from version |
---|---|---|
id | Knowledge Base ID. | |
groupId | Group ID. |
Example
BX24.callMethod( 'landing.site.unbindingFromGroup', { id: 32, groupId: 174 }, function(result) { if(result.error()) { console.error(result.error()); } else { console.info(result.data()); } } );
Getting bindings to groups
Method landing.site.getGroupBindings allows to find out binding to a specific group or to general groups exists. Returns only bindings to Knowledge Bases to which user has Read access.
Parameters
Parameter | Description | Available from version |
---|---|---|
groupId | Group ID for which binding is to be returned. Optional, returns all bindings to any groups by default. |
Example
BX24.callMethod( 'landing.site.getGroupBindings', { groupId: 174 }, function(result) { if(result.error()) { console.error(result.error()); } else { console.info(result.data()); } } );