imopenlines.crm.chat.user.add
Scope: imopenlines Permissions: for all
Adding user to CRM entity chat.
Parameters
Parameter | Required | Description |
---|---|---|
CRM_ENTITY_TYPE | yes | CRM entity type (lead/deal/company/contact). |
CRM_ENTITY_ID | yes | CRM entity ID. |
USER_ID | yes | User or bot ID to be added to chat. |
CHAT_ID | no | Chat ID. If empty, uses the most recent chat ID associated to CRM entity. |
Example
BX24.callMethod('imopenlines.crm.chat.user.add', { CRM_ENTITY_TYPE: 'deal', //lead|deal|company|contact CRM_ENTITY: 288, USER_ID: 12, CHAT_ID: 8773 }, function(result) { if(result.error()) { console.error(result.error().ex); } else { console.log(result.data()); } });
Response
Returns CHAT_ID on success.
Response example
8773
Possible error codes
Code | Description |
---|---|
ACCESS_DENIED | Current user doesn't have access. |
ERROR_ARGUMENT | One of arguments isn't specified or specified incorrectly. |
IM_NOT_INSTALLED | Module 'im' is not installed. |
CHAT_NOT_IN_CRM | Chat doesn't belong to a CRM entity. |
CRM_CHAT_USER_NOT_ACTIVE | Current user doesn't have access to list with users not active in the Open channel. |
© «Bitrix24», 2001-2024