h1. Integration with AmoCRM {{>toc}} Integration with "AmoCRM":http://amocrm.ru/ is implemented in Smartswitch. h2. Main functions The client has access to the standard functions of integration of AmoCRM with Telephony from the personal account of AmoCRM: * pop-up Contact window with an incoming call * call by clicking on the phone number (click2call) from all pages of AmoCRM * call history as notes to Contacts, Companies or Deals. * listening to audio recordings as notes to Contacts, Companies or Deals. h2. Additional functions The following additional functions are also available to the client in the widget settings: * *Forward to responsible user* When there is an incoming call from the city, Smartswitch identifies the Contact, Company or AmoCRM Deal by the caller's number. If the found element has a responsible user, then the call is directed to the phone of this user. * *Set caller name from contact* When there is an incoming call from the city, Smartswitch identifies the Contact, Company or AmoCRM Deal by the caller's number. When a call is directed to a user, Smartswitch substitutes the caller's name as the name of the found AmoCRM element. Thus, on his phone, the user sees more complete information about the caller. * *Create contact on incoming call* When there is an incoming call from the city, Smartswitch identifies the Contact, Company or AmoCRM Deal by the caller's number. If no such element exists, Smartswitch creates a new Contact. * *Create contact on outgoing call* When dialing a number from a user's phone, Smartswitch identifies a Contact, Company or AmoCRM Deal by the dialed number. If no such item exists, Smartswitch creates a new Contact. If users are allowed to make personal calls from office phones, then this option should not be enabled. * *Create a task when creating a contact* When a contact is automatically created, Smartswitch will automatically create a Task to fill this contact for the user who accepted the call. Completion time: 15 minutes. Thus, users will not forget to enter information on a new contact. * *Create task on missed call* When there is an incoming call from the city, Smartswitch identifies the Contact, Company or AmoCRM Deal by the caller's number. If the item was found, but the call was not answered, then the task to call back the client is added to the user who did not accept the call. Completion time: 15 minutes. This way, customers won't go unanswered. h2. The principle of integration with AmoCRM through a widget AmoCRM connects to third-party services through the Widgets mechanism. A widget is an archive that contains the program code for connecting to a third-party service and a set of user settings. Your client should select the widget he wants to connect in his personal AmoCRM account on the page with public widgets in the Integration section. The client specifies the username and password for the Smartswitch account in the widget settings. Assigns extension numbers for AmoCRM users. May also enable *additional functions* (see above). When saving the Streamco widget, the latter transmits to the Smartswitch server via the HTTPS protocol: * *client credentials from AmoCRM*. Smartswitch uses them to call the AmoCRM API over HTTPS. * *widget settings*. Smartswitch uses them to determine which features the client has enabled. For disabled features, Smartswitch will not call the AmoCRM API. After that, Smartswitch calls the AmoCRM API to transfer information to CRM. For example, when a new incoming call is detected, Smartswitch calls the AmoCRM API. AmoCRM in your personal account displays an incoming call card with a link to an existing contact or with a proposal to create a new contact. To implement click2call, the widget declares the connection scope location = "everywhere" in manifest.json. This activates click2call on all AmoCRM pages. When a user clicks on a phone number, the 'phone' action handler is called inside the widget, which sends an HTTPS request to the Smartswitch server. The request contains: - Smartswitch authorization data from widget settings - internal number of the user initiating click2call - clicked number Upon receipt of this request, Smartswitch initiates a callback to the specified extension number, which is routed to the user's softphone. After picking up the handset of the softphone, Smartswitch initiates a call to the clicked number and connects it with a callback to the user. Smartswitch saves information about calls as notes to a Contact, Company or AmoCRM Transaction using the appropriate AmoCRM API over HTTPS. To implement the * additional functions * mentioned above, the Smartswitch server calls the corresponding AmoCRM API over HTTPS. h2. Connection options The following options for connecting to your telephony based on Smartswitch are available to your customers: * [[Connection to AmoCRM via Streamco widget]] [[Интеграция_с_AmoCRM|Русский перевод]]