If your Customer Service System and your Sales CRM are separated it is important to integrate the systems. Without a proper integration either your Sales or Customer Service team might be missing important informations. This free Pipedrive and Zendesk integration will help you solve this issue.
Recently I had to use Zendesk as our customer success system and Pipedrive as our Sales CRM. I have worked with Salesforce for the past 6-8 years and love it. Moving to Zendesk and Pipedrive was quiet a bit of change for me. While these two systems are cheaper than Salesforce they do have a couple of drawbacks. When I started out with both systems I was looking for a Pipedrive and Zendesk integration and came across the official Pipedrive plugin for Zendesk.
The integration costs $3/per agent, per month. With this integration you will be able to view Organizations, People, Deal and Activity data within Zendesk. However the data itself is not actually synchronized and therefore tickets cannot be attached to an Organization which might exist already in Pipedrive.
I wrote a Python script called syncpipedrive.py which synchronizes Organizations and People form Pipedrive to Zendesk. This will make sure your Zendesk always an up to date copy of the Organizations and People data from Pipedrive. This will allow your Service Organization to create tickets and attach them to an existing Organizations.
To run the script, you’ll need to configure your credentials in config.json
{ "zendesk": { "enduserurl": "https://{subdomain}.zendesk.com/api/v2/users.json?role\[\]=end-user", "orgurl": "https://{subdomain}.zendesk.com/api/v2/organizations.json", "username": "", "apikey": "", "url": "{subdomain}.zendesk.com" }, "pipedrive": { "apikey": "" } }
How to find your Zendesk API key?
How to find your Pipedrive API key?
After filling in the config.json, add the following script to a cronjob. Be sure to have config.json and syncpipedrive.py in the same folder otherwise it won’t find the configuration file.
############################################################## # Copyright (c) 2018 MindTheVirt, Inc. All rights reserved. # # -- @MindTheVirt -- # ############################################################## import json import requests from datetime import datetime startTime = datetime.now() # retrieve config for pipedrive and zendesk with open('config.json') as config: data = json.load(config) zenuser = data['zendesk']['username'] zenapi = data['zendesk']['apikey'] pipeapi = data['pipedrive']['apikey'] orgurl = data['zendesk']['orgurl'] enduserurl = data['zendesk']['enduserurl'] # zendesk authentication user = zenuser + '/token' pwd = zenapi urls = [] urls.append(orgurl) urls.append(enduserurl) for url in urls: response = requests.get(url, auth=(user, pwd)) if response.status_code != 200: print('Status:', response.status_code, 'Problem with the request. Exiting') exit() # get organizaitons from pipedrive and create them in zendesk startnum = 0 limitnum = 50 print "Start sync of organizations from pipedrive to zendesk" while True: response = requests.get('https://api.pipedrive.com/v1/organizations?start=0&api_token=%s&start=%s&limit=%s' % (pipeapi, startnum, limitnum)) orgdata = response.json() organizations = orgdata['data'] # For each company, try to create it in zendesk if organizations: for i in organizations: data = {"organization": {"name": i['name']}} payload = json.dumps(data) headers = {'content-type': 'application/json'} response = requests.post(orgurl, data=payload, auth=(user, pwd), headers=headers) if response.status_code == 201: print "%s has been created" % i['name'] startnum = startnum + 50 limitnum = limitnum + 50 else: print "Synchronized all organizations from pipedrive to zendesk" break # get persons from pipedrive and create users in zendesk startnum = 0 limitnum = 50 print "Start sync of persons from pipedrive to zendesk" while True: response = requests.get('https://api.pipedrive.com/v1/persons?start=0&api_token=%s&start=%s&limit=%s' % (pipeapi, startnum, limitnum)) personsdata = response.json() persons = personsdata['data'] if persons: for p in persons: if p['org_id'] and p['email'][0]['value']: data = {"user": {"name": p['name'], "email": p['email'][0]['value'], "organization": {"name": p['org_id']['name']}}} payload = json.dumps(data) headers = {'content-type': 'application/json'} response = requests.post(enduserurl, data=payload, auth=(user, pwd), headers=headers) if response.status_code == 201: print "%s has been created under %s" % (p['name'], p['org_id']['name']) startnum = startnum + 50 limitnum = limitnum + 50 else: print "Synchronized all contacts from pipedrive to zendesk" break runtime = datetime.now() - startTime print 'Sync took %s' % runtime
All of the above is also available on my Github page.