Connection in the interface Planfix (https://planfix.com/ru/help/API_for_telephony)
To connect and configure the integration, go to Integrations — Virtual PSTN
In the section that opens, select Api Planfix for telephonies (at the end of the list).
The integration settings window opens.
The values in these fields will be needed to configure the connection on the Unitalk side.
2. In the PBX Address field, specify the link to which requests from Planfix will be sent according to the template (in the screenshot above, the Planfix account subdomain is set to testic):
https://planfix.unitalk.cloud/planfix/telephone?name=<subdomain account Planfix>
In the field Authorization key PBX – Api key from personal cabinet Unitalk. In the section Integrations – API it is necessary to create it.
3. In the paragraph Short phone numbers of employees the employee’s connection is indicated – SIP number, that is Each SIP number of the internal line in Unitalk must correspond to an employee in Planfix. Without them, there will only be information about missed incoming calls. It is obligatory to specify.
4. It is possible to configure how to store the recording of the conversation.
5. If you want to forward the call to the responsible manager, use this item. If there is a Call to a responsible manager with API request in the Unitalk Inbound scripts and the call forwarding is turned off, only the contact name will be returned to Planfix, if there is one. Optionally.
6. If you need information about the external line in the analytics, which received the call. The telephone number of the line (can be more than just a number) corresponds to the value of the external Unitalk line. Optionally.
It is also possible to save additional information about a completed call to the analytics, for this you need to create a field in the analytics with the name of the analytics Unitalk label of interest, the following values are available:
To add analytics fields, go to Account Management — Analytics — Telephony.
For Call and Missed Call entities add fields with specified names and data type “String”.
For successful saving of Call and Missed Call entities it is necessary to set the default value of the Duration (sec) field to 0.
If this data will not be collected, then in the appropriate field when filling, you must specify “0”.
Connection in the interface Unitalk
1. In the section Event processing choose ADD AN ACTION.
2. In the drop-down menu Action select Send webhook.
3. Specify the name of the event handler (as an example planfix calls) a little later on it is configured Outbound webhooks. URL matters: https://planfix.unitalk.cloud/unitalk/call. HTTP method we leave POST/
4. Add parameters to the URL. The key name takes the value of the Planfix account subdomain. If you need analytics tags, add the same key with_utm with an arbitrary value without specials. symbols (&=;%№»! и т.д.), can be left blank, it is important to have a key to process the marks. Example of configured fields with analytics labels:
5. Adding keys in HTTP Header. The following keys and values are used:
- planfix-url – the value from the first setting on the side Planfix, Address for accepting requests;
- planfix-token – the value from the first setting on the side Planfix, Authorization key (token) Planfix;
- token – value specifies the Api key that was created in the Integration section – API and introduced in the second item on the configuration on the side of Planfix, Authorization key PBX.
An example of a configured HTTP Header:
6. Don’t forget to save.
7. Go to Integration — API, in the form Call Event Handling (Outbound WebHooks) for each of the 4 provided events add the handler created earlier. The result:
8. Optional. If call forwarding to the responsible manager is required, in the section IP Telephony — Incoming scripts in the existing script or in the newly created one, add the item A call to the responsible manager.
In the Search for Responsible drop-down list, choose Query in Your API. In the Specify URL field, enter the link according to the following template:
https://planfix.unitalk.cloud/unitalk/call_route?planfix–url=<Address for receiving requests from step 5>&planfix–token=<PlanFix authorization key (token) from step 5>&name=<the subdomain from step 5>
An example of a finished link: