imopenlines.session.open
Scope: catalog Permissions to execute: for all
Method returns chat ID by USER_CODE.
Parameters
Parameter | Example | Required | Description |
---|---|---|---|
USER_CODE | livechat|58|2042|479 | Yes | Chat ID, can be found in ENTITY_ID. |
Method call and response
JavaScript for Bitrix24 On-premise.
BX.rest.callMethod( 'imopenlines.session.open', { USER_CODE: 'livechat|58|2042|479' } ) .then(result => console.log(result.data())) .catch(result => console.warn(result.error().ex)) ;
JavaScript for Bitrix24 Cloud:
BX24.callMethod( 'imopenlines.session.open', { CHAT_ID: 2024 }, function(result) { if(result.error()) { console.warn(result.error().ex); return false; } console.log(result.data()); } );
Response example:
{ "chatId":"2043" }
Possible error codes
Code | Description |
---|---|
ACCESS_DENIED | Current user doesn't have access to the specified chat. |
© «Bitrix24», 2001-2024