Call Import (with source attribution by phone number and call date)
How it works
If you wish to use your own phone numbers configured in your PBX system to track call sources, Calltouch can integrate with it.
In your request, specify that you need to obtain login credentials and a token for the Calltouch PBX to import calls from your PBX system. We will then perform the necessary configurations on our end and send you the authorization data (login and token), which you can use to send HTTP requests to our PBX and create calls in the statistics.
Thus, after a call to your number is completed, your PBX system should send an HTTP request to our service containing all information about the incoming call, and Calltouch will match this information with its own data about the website visitor who was assigned the phone number that received the call at that time. This way, Calltouch will determine the call source.
Sending a Request to Import a Call into Calltouch
HTTP Request
https://ats.calltouch.ru/event-service/platform/{ATS_CODE}/inbound-call
where, {ATS_CODE} — is the PBX login in Calltouch, provided upon request to your personal Calltouch account manager or by email at info@calltouch.net.
Supported request method: GET.
| Parameter | Format | Required | Description |
| calls | array | Yes | Array of calls. You can list up to 100 calls in one request. After sending the import request, calls are queued and imported in order. You will receive an import queue log ID in response, which can be used to check the import result. Mandatory. |
| calls.referenceId | string | Yes | Unique call ID. Any characters, max 100. Must always be unique for different requests. Calls with duplicate referenceId cannot be re-imported, even if previously imported call was deleted. |
| calls.sipCallId | string | No | Unique call ID from PBX. Any characters, max 45. Must always be unique for different requests. Calls with duplicate sipCallId cannot be re-imported, even if previously imported call was deleted. |
| calls.clientPhoneNumber | string | Yes | Client phone number in digit-only format 0123456789. |
| calls.callCenterPhoneNumber | string | Yes | Phone number that the client called. |
| calls.callStartTime | string | Yes | Call date and time in format yyyy-mm-dd hh:mm:ss, e.g., "2020-10-01 02:10:00". |
| calls.duration | integer | Yes | Total call duration including waiting time, in seconds. |
| calls.waitingTime | integer | Yes | Operator waiting time before answering, in seconds. |
| calls.status | string | Yes | Call status. Possible values: "successful", "missed", etc. |
| calls.recordUrl | string | No | URL link to the call recording in mp3 format. |
| calls.comment.text | string | No | Comment on the call. Any characters, max 1000. |
| calls.addTags | array | No |
Tags to add to the call. If tags already exist in the personal account, new ones are not created but existing ones are used. Any characters, max 100 per tag. Max 100 tags per call. Format example: "addTags": [{"tag": "Tag1"}]
|
| calls.manager | string | No | Manager who answered the call. Any characters, max 50. |
| calls.customSources | object | No | Custom call sources, used only if sessionId is not specified. Optional. If neither sessionId nor customSources are specified, the call is created without a source. |
| calls.customSources.source | string | Yes, if customSources specified | Custom source name. |
| calls.customSources.medium | string | Yes, if customSources specified | Custom medium/channel. |
| calls.customSources.campaign | string | Yes, if customSources specified | Custom campaign name. |
| calls.customSources.content | string | No | Custom ad content. |
| calls.customSources.term | string | No | Custom keyword phrase. |
| calls.sessionId | string | No | Calltouch session ID. Any characters, max 100. If not specified, the call will be assigned the customSources source. More details in the article: "Obtaining Calltouch sessionId". |
| calls.customFields | array | No |
Custom fields data for the call. To use, custom fields must be added in the Calltouch API personal account settings beforehand. Custom fields can be of various types. Allowed content per field type is described in the documentation. Format example: "customFields":[{"field": "name", "value": "Vasya"}, {"field": "birthday", "value": "1990-01-01"}]
|
Creating a Call by Client Phone Number and Call Date/Time
You can create calls in Calltouch using the client’s phone number and the call date/time. For this, use the parameter model=telemirfact and pass the corresponding values.
Example of Filled Parameters
model=telemirfact apikey=dL9juaKJnm4kSNzDhHIxtgeb9ZCxRoDE callid=dfjhvbskdjfvlsdkfjb1233443 callerid=74955550101 phonenumber=78126007428 destphonenumber=78126007428 date=2019-02-27%2012:03:00 duration=30 waitingtime=10 status=successful clientdtmf=567,789 operatordtmf=123,456 callrecordurl=https://test.ru/calltouch/mp3/dialup.mp3
Example HTTP Request
https://ats.calltouch.ru/event-service/platform/{ATS_CODE}/inbound-call?model=telemirfact&apikey=dL9juaKJnm4kSNzDhHIxtgeb9ZCxRoDE&callid=dfjhvbskdjfvlsdkfjb1233443&callerid=74955550101&phonenumber=78126007428&destphonenumber=78126007428&date=2019-02-27%2012:03:00&duration=30&waitingtime=10&status=successful&clientdtmf=567,789&operatordtmf=123,456&callrecordurl=https://test.ru/calltouch/mp3/dialup.mp3
Example JSON Response for a Successful HTTP Request
When importing calls with the parameter model=telemirfact:
61924734
where the numeric value is the HTTP request ID on the Calltouch PBX side (technical information, not useful for you).
Creating a Call by Session ID
You can create calls in Calltouch using the session ID. For this, use the parameter model=sessionfact and pass the corresponding values.
Example of Filled Parameters
model=sessionfact apikey=dL9juaKJnm4kSNzDhHIdfkvj callid=dfjh21234245vbskdj245fvdfvdfsv callerid=74955550101 ctSessionID=12312424234 siteId=6969 date=2019-02-27%2012:03:00 duration=30 waitingtime=10 status=successful clientdtmf=567,789 operatordtmf=7 callrecordurl=https://test.ru/calltouch/mp3/dialup.mp3
Example HTTP Request
https://ats.calltouch.ru/event-service/platform/{ATS_CODE}/inbound-call?model=sessionfact&apikey=dL9juaKJnm4kSNzDhHIdfkvj&callid=dfjh21234245vbskdj245fvdfvdfsv&callerid=74955550101&ctSessionId=12312424234&siteId=6969&date=2019-02-27%2012:03:00&duration=30&waitingtime=10&status=successful&clientdtmf=567,789&operatordtmf=7&callrecordurl=https://alftest.ru/calltouch/mp3/dialup.mp3
Example JSON Response for a Successful HTTP Request
When importing calls with the parameter model=sessionfact: json
{
"success": true,
"eventId": 61924734
}
where the success parameter value true means the HTTP request was successful, and the eventId parameter contains the HTTP request ID on the Calltouch PBX side (technical information, not useful for you).
- A/B тестирование (раздел «Подключение»)
- Email-трекинг (раздел «Подключение»)
- Отслеживание офлайн конверсии (раздел «Подключение»)
- Подключение к отслеживанию дополнительных доменов (раздел «Подключение»)
- Подмена номеров на AMP-страницах Google (раздел «Подключение»)