Documentation

imopenlines.crm.chat.user.delete

Scope: imopenlines Permissions: for all

Deleting user from CRM entity chat.

Parameters

Parameter Required Description
CRM_ENTITY_TYPE yesCRM entity type (lead/deal/company/contact).
CRM_ENTITY_ID yesCRM entity ID.
USER_ID yesUser or bot ID to be added to chat.
CHAT_ID noChat ID. If not specified, uses the most recent chat associated to CRM entity.

Example

BX24.callMethod('imopenlines.crm.chat.user.delete', {
	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.
CRM_CHAT_EMPTY_USER User ID is not specified.
CRM_CHAT_EMPTY_CRM_DATA CRM data is not defined.
IM_NOT_INSTALLED Module 'im' is not installed.
CHAT_NOT_IN_CRM Chat doesn't belong to CRM entity.
CHAT_DELETE_USER_PERMISSION_DENIED User doesn't have access to CRM entity.
CRM_CHAT_USER_NOT_ACTIVE Deleted user isn't active.


© «Bitrix24», 2001-2024