Telephony integration with CRM: what to rely on when setting up your own


    Today I want to talk about the integration of telephony with CRM with advanced control over the data transferred between systems. So that you can implement a similar task yourself:

    1. I will show how we ourselves implemented the ready-made integration of a virtual PBX with retailCRM based on our API. The same logic can be transferred to the desired integration with your system (I’ll say that this is not an instruction, but the foundation for the integration of other exchanges with retailCRM or other CRMs with UIS telephony).
    2. I’ll tell you about the key data management functions that are wired into our API and on which similar integration schemes are based.

    An example of basic telephony integration with CRM

    Let's see how to make telephony integration with CRM with support for basic functionality using retailCRM as an example. At the same time, we make a reservation that by basic functionality we mean:

    • Contact pop-up card
    • Fix lost calls in CRM
    • Outgoing calls from CRM
    • Listening to conversation records in a CRM system

    Specifically, in the UIS integration scheme with retailCRM, we implemented several more useful functions (for example, synchronizing employee statuses in services, etc.). However, it is thought that they still go beyond the basic functionality of such integrations, so I will not dwell on them in detail in this material.

    Used tools

    The article also implies that for the integration to work, a server connector is required that provides the interaction of cloud PBX and CRM.

    General scheme of integration


    Click on the diagram to view full size.


    Telephony activation in retailCRM

    Telephony in retailCRM is activated by a request to / api / v4 / telephony / setting / {code} / edit . Among others, the request indicates the following parameters:

    • makeCallUrl - URL to which retailCRM will send requests to generate outgoing calls.
    • changeUserStatusUrl - URL to which retailCRM will send alerts about changes in employee status.

    Call processing

    Contact pop-up card

    A pop-up contact card in retailCRM is carried out by a simple request to API / api / v4 / telephony / call / event , the trigger will be a triggered notification for the event "Waiting for a reply" when the employee already has a phone call.

    Missed calls

    A call is missed or successful, can be determined by the is_lost parameter in the call completion notification. And if the call is missed, then the call status will be loaded with the request API / api / v4 / telephony / calls / upload , the fields of which can be filled with the parameters from the notification.

    Successful calls and saving their records in CRM

    To load a successful call to retailCRM, you first need to get additional information on this call, which the Data API will help to cope with.

    A little bit about query layout:

    • In the params field, you can specify the parameters of interest, so that only they come in the answer
    • In the filter field, you can specify the name of those fields that interest you

    What does it look like
      "jsonrpc": "2.0",
      "id": 1122,
      "method": "get.call_legs_report",
      "date_from": "2017-06-01 14:34:00",
      "date_till": "2017-06-01 14:36:52",
      "params": {
        "access_token": "N2dw2Rf33fn23fknkmdfeJmcP",
        "filter": {
            "filters": [
                    "field": "call_session_id",
                    "operator": "=",
                    "value": 31451224
                    "field": "is_talked",
                    "operator": "=",
                    "value": true
            "condition": "and"
        "fields": [

    The received information must be uploaded to retailCRM by requesting the API / api / v4 / telephony / calls / upload . If you want to expand the set of downloadable parameters, they can be taken from the parameters of the “End call” notification.

    Outgoing call from retailCRM on click

    When an employee tries to call by clicking on the contact number from the CRM interface, retailCRM will send you a request for the URL specified when activating telephony. Now you need to redirect this request to the telephony service to make a call. You can use our Call API for this.

    What does it look like
      "jsonrpc": "2.0",
      "method": "start.employee_call",
      "id": "number",
      "params": {
        "access_token": "N2dw2Rf33fn23fknkmdfeJmcP",
        "first_call": "employee",
        "early_switching": true,
        "switch_at_once": true,
        "show_virtual_phone_number": false,
        "virtual_phone_number": "88002000600",
        "direction": "out",
        "contact": "72131231111",
        "employee": {
          "id": 13421

    Synchronization of employee statuses in retailCRM and UIS

    When receiving notification of a change in employee status from retailCRM, it is necessary to generate a request to the Data API to change the employee’s settings in accordance with the new status.

    What does it look like
      "jsonrpc": "2.0",
      "id": "number",
      "method": "update.employees",
      "params": {
        "access_token": "N2dw2Rf33fn23fknkmdfeJmcP",
        "id": 13421,
        "calls_available": false

    The nuances of data management through the UIS API

    And now, as promised, I will talk about the key functions for controlling the data transmitted between telephony and CRM, which we provided for in the updated UIS API.

    • Controlled data protection. Requests to the API are made on keys with differentiated access rights. API keys are created for a specific user and have a set of rights similar to the user’s privileges in the UIS Account. For example, if he has only access to view employees, and he cannot edit their profiles in the UIS interface, then he will not be able to do this through the API.
    • Log-log of requests in your account. Another important step towards increasing the transparency of the whole process of working with the API.
    • Flexible filtering conditions for receiving data. You can set the conditions yourself.
    • Passing arrays in queries to get a list of specific entities (employees, calls, etc.). Previously, in order to get, for example, the profiles of Kolya, Vasya and Petya's employees, you had to make three API requests, but now this is one request that contains the IDs of the necessary employees.
    • Partial data update. It is not necessary to send the entire sheet of properties of the updated entity in the update request - it is enough to send only those fields that have really changed.
    • Individual definition of the received fields. In the request for data, only the parameters you are interested in are set. Profit - filtering trash in the form of unnecessary information.
    • A well-thought-out error system. This is in order to simplify the diagnosis of problems.

    We planned to launch the functionality publicly in July, but I’m ready to tell more if you want to implement your integration scheme, similar to the one described above, and you need the details now (I’d better write here ).

    PS By the way, if you are a representative of a CRM system that lacks integration with telephony, then I will also be glad to cooperate. You will help us to work out the scheme of ready-made partner integrations with one click from the UIS Personal Account, and we will help you to integrate our services for your users.

    Also popular now: