Integration of telephony with third-party services - Vochi-CRM

API. Integration of telephony with third-party services

Access to telephony events occurs via the Signalr Core client (Web sockets or Longpolling Connection)

Example of connecting and accessing JavaScript-based events

                    var connection = new signalR.HubConnectionBuilder()
                    .withUrl("http://crm.vochi.by/atsHub?apiclienttoken=" + $("#apitoken").val())
                    .configureLogging(signalR.LogLevel.Information)
                    .build();


                    connection.start().done(function () {
                    $("#status").html("Connected");
                    });

                    connection.on("onCallEvent", function (data) {
                    $("#events").append("

" + JSON.stringify(data) + "

"); console.log(data); });

Download sample: VochiClient_Javascript.zip

Examples of events

{"UniqueId":"1527238123.1370","Phone":"375447778899","IsOutgoing":true,"EventName":"Dial","Extensions":["161"],"TrunkPhone":"BelTeleCom 3880903"} {"UniqueId":"1527238123.1370","Phone":"375447778899","IsOutgoing":true,"EventName":"Bridge","Extensions":["161"],"TrunkPhone":"BelTeleCom 3880903"} {"UniqueId":"1527238123.1370","Phone":"375447778899","IsOutgoing":false,"EventName":"Hangup","Extensions":[],"TrunkPhone":null} {"UniqueId":"1527238149.1373","Phone":"0447778899","IsOutgoing":false,"EventName":"Dial","Extensions":["180"],"TrunkPhone":"BelTeleCom 3880903"} {"UniqueId":"1527238149.1373","Phone":"0447778899","IsOutgoing":false,"EventName":"Dial","Extensions":["185"],"TrunkPhone":"BelTeleCom 3880903"} {"UniqueId":"1527238149.1373","Phone":"0447778899","IsOutgoing":false,"EventName":"Hangup","Extensions":[],"TrunkPhone":null}

Call initialization

http://crm.vochi.by/api/makecallexternal?clientId=#token&code=#internalPhone&phone=destinationPhone

HTTPS API. Base url

Basic information.


Every query must contain HEADER:
  • ("Accept", "application/json")
  • ("Content-Type", "application/json; charset=utf-8")
  • ("Client", "#clientId:#clienttoken")

Input Data Format:
  • Date:yyyy-MM-dd

Get Call Logs.

Address: https://crm.vochi.by/api/v01/CallLogs , method: POST, input parameters: Start,End - Date range

Get Call Record.

Address: https://crm.vochi.by/callrecordsexternal/#uniqueId?token=#apitoken , method: Get, input parameters: uniqueId - call record id, apitoken - api token

Get list incoming smses.

Address: https://crm.vochi.by/api/v01/SmsIn , method: POST, input parameters: Start,End - date range

Get list outgoing smses.

Address: https://crm.vochi.by/api/v01/SmsOut , method: POST, input parameters: Start,End - date range

Get customer data (static fields).

Address: https://crm.vochi.by/api/v01/Customers , method: POST, input parameters: updatedSince - date last client update (optional),Phone - customer phone number (optional)

Get customer dynamic fields.

Address: https://crm.vochi.by/api/v01/CustomersClaims , method: POST, input parameters: updatedSince - date last client update (optional),Phone - customer phone number (optional)

Update customer data (static fields only).

Address: https://crm.vochi.by/api/v01/Customers/Update , method: POST
[{"FirstName":"Антон","SecondName":"Сергеевич","LastName":"Ваушилин","Phone":"375CC38811OO"},{"FirstName":"Сильвестр","SecondName":"Андреевич","LastName":"Булыгин","Phone":"74951XX42Z2"}]

Update customer data (dynamic fields).

Address: https://crm.vochi.by/api/v01/CustomersClaims/Update , method: POST . CustomerId=phonenumber or 8 last digits
[{"CustomerId":12345678,"Name":"Email","Value":"test@example.com"},{"CustomerId":12345678,"Name":"Спрашивают ли имя","Value":"1"},{"CustomerId":47148079,"Name":"Просто Дата","Value":"2017-01-14"}]