imopenlines.crm.message.add
Scope: imopenlines Permissions: for all
Sending message from 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 | yes | Chat ID. |
MESSAGE | yes | Message text. |
Example
BX24.callMethod('imopenlines.crm.message.add', { CRM_ENTITY_TYPE: 'deal', //lead|deal|company|contact CRM_ENTITY: 288, USER_ID: 12, CHAT_ID: 8773, MESSAGE: 'Message text' }, function(result) { if(result.error()) { console.error(result.error().ex); } else { console.log(result.data()); } });
Response
Returns sent message ID.
Response example
19880117
Possible error codes
Code | Description |
---|---|
ACCESS_DENIED | User doesn't have access. |
ERROR_ARGUMENT | One of arguments isn't specified or specified incorrectly. |
CHAT_NOT_IN_CRM | Chat doesn't belong to a CRM entity. |
MESSAGE_ADD_ERROR | Error while sending message. |
© «Bitrix24», 2001-2024