getMessengerLink
\Bitrix\ImOpenLines\Tracker::getMessengerLink($lineId, $connectorId, $crmEntities)
Method gets link to Telegram bot with start parameter with associated listed CRM objects. Customer follows the link, starts an Open channel conversation at the Bitrix24 instance. CRM connects to this chat and creates an Activity - incoming open channel conversation.
Returns structure with two links
array{web: string, mob: string}
- for browser: https://t.me/bot_name?start=xxxx
- for mobile device: tg://resolve?domain=bot_name&start=xxxx
Parameters
Parameter | Format | Description | Available from version |
---|---|---|---|
$lineId | int | Channel ID. | |
$connectorId | string | Channel ID. | |
$crmEntities | array | Array with CRM object IDs to associate the conversation. |
Example
$tracker = \Bitrix\Main\DI\ServiceLocator::getInstance()->get('ImOpenLines.Services.Tracker'); $tracker->getMessengerLink( $lineId, 'telegrambot', [ [ 'ENTITY_TYPE_ID' => \CCrmOwnerType::Deal, 'ENTITY_ID' => 89, ], [ 'ENTITY_TYPE_ID' => \CCrmOwnerType::Contact, 'ENTITY_ID' => 83, ], [ 'ENTITY_TYPE_ID' => \CCrmOwnerType::Company, 'ENTITY_ID' => 83, ], [ 'ENTITY_TYPE_ID' => \CCrmOwnerType::Lead, 'ENTITY_ID' => 83, ], ] );
© «Bitrix24», 2001-2024