Documentation

telephony.externalCall.searchCrmEntities

Scope: catalog Permissions to execute: for all

This method allows to retrieve information about a client from CRM by a telephone number via single request. This information allows to make a decision, to which employee the inbound call shall be forwarded to at the very moment of the call. This method returns a suitable list of CRM objects with sorting by internal priorities. If different employees are responsible for entities, linked with the number (one employee is responsible for a lead, and another employee is responsible for a company), then it is recommended to select the object, which was returned by the method as the first in the list. If integration has its own logic, then a selection is possible, because all the objects are transferred.

All information about an employee, responsible for each object is provided right away in the list of CRM objects (so that there is no necessity to retrieve this information via additional REST requests). All contact phone numbers specified for a user are returned: internal telephone number for an employee, work office and etc.

An employee workday status is also returned (if work time management feature is enabled in the user's Bitrix24 account). The integration can check, whether an employee is located at the workplace at the moment (or he/she is having a lunchtime break), or it can forward a phone call to a queue, or forward a call to a mobile phone of an employee and etc.

It is recommended to call this method prior to calling the telephony.externalcall.register method.

Parameters

Parameter Description Available from version
PHONE_NUMBER Client phone number. Required parameter.

Example

Example of the returned data

Array
(
    [0] => Array
       (
           [CRM_ENTITY_TYPE] => CONTACT
           [CRM_ENTITY_ID] => 1
           [ASSIGNED_BY_ID] => 1
           [ASSIGNED_BY] => Array
               (
                   [ID] => 1
                   [TIMEMAN_STATUS] => CLOSED
                   [USER_PHONE_INNER] => 102
                   [WORK_PHONE] => 
                   [PERSONAL_PHONE] => 
                   [PERSONAL_MOBILE] => 79062195047
               )

       )

   [1] => Array
       (
           [CRM_ENTITY_TYPE] => COMPANY
           [CRM_ENTITY_ID] => 4
           [ASSIGNED_BY_ID] => 1
           [ASSIGNED_BY] => Array
               (
                   [ID] => 1
                   [TIMEMAN_STATUS] => CLOSED
                   [USER_PHONE_INNER] => 102
                   [WORK_PHONE] => 
                   [PERSONAL_PHONE] => 
                   [PERSONAL_MOBILE] => 79062195047
               )

       )

)


© «Bitrix24», 2001-2024
Up