The content of the article describing how to integrate a call center with AmoCRM :
1. Integration and opportunities;
2. Creation of integration;
3. Widget connection in AmoСRM;
4. Creating webhooks for:
a. C creation of transactions\contacts in AMOCRM in case of events from Oki-Toki (incoming calls, clicks on the IVR, etc.);
b. Calling on events from AMOCRM: lead creation, lead status change.
The article belongs to the section IT department tools
Integration and features
Oki-Toki and AmoCRM can exchange data about deals, leads and calls. The code for this is ready and merged into a ready-made integration. Here’s what you can do with it.
1. Adding deals and leads from AmoCRM for automatic calling to Oki-Toki when performing the following actions:
a. Creating a deal;
b. Create a contact;
c. Creating a contact and deal;
d. Deal status update;
e. Manual addition from AmoCRM.
2. Creating deals in AmoCRM when:
a. Changes in the status of a call (task) in Oki-Toki;
b. Selected events in the IVR.
3. Making calls from a customer card using a provider in Oki-Toki.
Below you will learn how to integrate a call center with AmoCRM and set it up to solve popular tasks.
Create an integration
To set up the integration of Oki-Toki and AmoCRM, you need to follow these steps:
1. Log in to AmoCRM to connect to Oki-Toki. To do this, go to the \”External resources\” menu and click \”Connect\”. Select \”AmoCRM\” and specify the name of the integration;

2. In the integration settings, select queues and dialers to automatically open a customer card. Activate the option \”Call logging\” and \”Autocall logging\” so that all call attempts are recorded in the client card in AmoCRM and a player is displayed for playing audio recordings of the conversation;

3. Click the \”Save\” button. After that, you will be prompted to add authorization. Click the \”Install Integration\” button and select the AmoCRM account you want to integrate with. Press \”Allow\”;

4. Integration will be installed automatically. In the plugin settings you will see that your AmoCRM account is linked to Oki-Toki.
If you need to change your plugin account in the future, you can change the current settings or create a new plugin.
Connecting the Oki-Toki widget in the AmoCRM service
To connect the Oki-Toki widget in AmoCRM, you need to complete the following steps:
1. Go to your AmoCRM account settings (appropriate rights are required) and start typing the widget name in the search bar. Find the desired widget and click \”Install\”;
2. Confirm the transfer of information by checking the box and click \”Install\”;
3. After installing the widget, you will need to add the API token, which can be found in your profile settings in Oki-Toki, to the corresponding field of the AmoCRM employee. This will allow you to make calls from the lead card to AmoCRM through the operator panel.
(Important! For each user, you need to generate and enter his api-token into the widget separately).

After configuring the widget, the following functions will become available to you:
Calls from the lead card in AmoCRM on click (to make a call, the operator must be in the opera place);
Manual addition of tasks through list management. You just need to select the necessary tasks and through the menu you can add or remove from the desired dialer;
Logging the history of calls on dialers and queues, as well as listening to records of conversations from the client card.
Webhook for creating deals\contacts in AmoCRM for events from Oki-Toki
Below is an example of using the system to automatically create deals in AmoCRM when calling a client. In the event that the client, after listening to the message of the informant, clicks on the number “1”, the system will automatically create a new deal/lead in AmoCRM.
In order to automatically create a deal in AmoCRM using events in Oki-Toki, you need to do the following:
1. Go to the Events and Integrations menu in Oki-Toki.
a. Give the name of the integration and select the desired event, for example \”Call Function\”;
b. Select the plugin for AmoCRM installed earlier and the required action, for example, \”create a deal and contact in AmoCRM\”;
c. Set trigger conditions by specifying that when you click on the number \”1\” in the IVR, you must send the deal to AmoCRM;

d. Set up the action parameters by specifying how the deal will be called in AmoCRM.
2. Fill in all the required fields (name, status, funnel, responsible, contact) according to the settings in AmoCRM in order to correctly create a lead or deal with the necessary information;

3. Once all the fields have been filled in and configured, we can save our integration and activate it.
After the manipulations, when the client dials the number, listens to the message from the IVR and presses the number \”1\”, in accordance with the settings in our integration, a new deal or lead is created in AmoCRM.
Creating a task in Oki-Toki dialer in case of events from AmoCRM
Let’s consider another important case – creating a task for calling in case of events in AmoCRM. To implement it on the AmoCRM side, you need to perform a number of actions:
1. Go to AmoCRM in the deal menu and click on the “Set up funnel” button in the right corner:
a. Select the desired funnel and click on it ;
b. From the modal that appears, select “Send webhook”;

2. In the field “Specify URL” add a link from our integration. Link example: https://newlook.oki-toki.net/api/v1/amo?plugin=87&api_token= (user token).
After adding, you will need to add the user’s api-token to the link, which is generated in the user settings in Oki-Toki.

Important! It is advisable to leave only those webhook trigger parameters for which an event is expected, otherwise AmoCPM may take many requests for spam and disable webhook processing.
Next, to continue the implementation of the case, you need to go to the Oki-Toki interface and perform a series of actions:
1. Initially, you need to create a webhook, for this you need to go to “External Resources”, and then select a webhook from the drop-down list on the “Connect” button:
a. Specify in the “URL” field a link from the api documentation for creating a task in autocall. Link example: https://noname.oki-toki.net/api/v1/dialers/create_task ;
b. Select the post method and in the field “General query parameters”;
c. Then in the field “General query parameters” specify api_token = (user token in Oki-toki)
2. Next, create an event for the trigger by selecting:
a. in the field “Event type” – AmoСrm;
b. in the line “External integration” specifying the previously created webhook;
c. in “Trigger conditions” it is necessary to set the parameters previously configured in Amo, namely the status of the event and the action under which it is triggered;

d. in the “Action parameters” it is necessary to specify such variables for creating a call in a specific auto-dial, as dialer_id=1, where 1 is the id of the auto-dial, phones = is the user’s phone from Amo.
