The goal of integrating JivoChat with a CRM system is to save data from JivoChat into the leads/customer section of your CRM and also to show updated information (e.g. visitor contact info, lead details, account balance, etc.) in the JivoChat agent’s application (a.k.a. the application where JivoChat users receive chats from their customers).
To activate an integration, all you have to do is insert an Endpoint URL from your CRM or server in the settings of the channel where you want to activate the integration. After inserting it, we’ll automatically start sending Webhooks to the specified URL containing all information about new conversations from that channel.
To insert a URL to receive Webhooks, access the Jivo web app or one of our Desktop apps and go to Manage -> Channels -> Settings (below a channel name).
Next, enter the menu “Integration Settings for Developers”, activate the option “Enable Webhooks” and insert your Endpoint URL in the “Webhooks Endpoint URL” field.
That’s it! From now on, Jivo will automatically send all webhooks from new conversations to the specified URL.
The JivoChat system sends an HTTP POST request to the specified URL in such cases:
You can use our documentation on https://www.jivochat.com/docs/
Main data that JivoChat sends:
JivoChat can receive responses from your CRM system with the following data:
function jivo_onLoadCallback(){
jivo_api.setUserToken("a link | id | any data");
}
JivoChat doesn’t process the user_token and it won’t show anywhere, it will just transfer all of it’s data to your CRM.
The JivoChat webhook request is an HTTP request with POST method to specified URL. Request body is a JSON object with all data that you can find in the documentation. Here is an example in PHP for how to get a request and save it in a log file:
<?php
$fp = fopen('/request.log', 'a');
fwrite($fp, file_get_contents('php://input'));
fclose($fp); ?>
Of course it doesn’t mean that you should use a text file to keep all data. It is just an example that can be used to check how it works and how our request looks like. Next you should parse this data, push it into your base, search for a lead record and so on. After that, your CRM should send a response with the customer’s data in the object like it is described in the documentation. You can use just something like the echo function in PHP, without any additional HTTP headers.
Here is what a response looks like:
{"result":"ok","custom_data":[{"title":"Answer","content":"42"},{"title":"Last chat","content":"27 Sep 2016 19:37:12"}],"contact_info":{"name":"John Doe","phone":"+79500123567","email":"johny1337@jivoteam.com","description":"Visitor comment"},"enable_assign":true,"crm_link":"http:\/\/mycrm.ru\/user\/1"}
And from in a browser:
This is what users are usually expecting from integrating with a CRM system
Once your CRM is contacted by the JivoChat system (either when a chat_accepted or chat_updated event happens) it should look for that customer in your CRM and if a customer with the specified contact information exists, then your CRM should populate the rest of that customer’s full data into JivoChat and also insert a link back to that customer’s profile in your CRM. If that customer doesn’t exist in your CRM, a new customer/lead account should be created for them automatically by the known data that JivoChat sends to your CRM.
Lead record creation
Please pay attention to data priority. What data will be recorded or deleted? If a user introduced themselves in a chat and specified email address A and phone number B, but in CRM there is a lead with email A and phone number C. What number should be saved, oldest or newest? It is probably more desirable if the CRM has fields for additional phones and emails.