Page 1 of 1

CRM API Integration

PostPosted: Wed Oct 19, 2022 5:17 pm
by evroggio
Hello,

I'm running ViciDial VERSION: 2.14-859a / BUILD: 220623-0824.

I am looking to integrat with PipeDrive by sending a lead to PipeDrive using the webform button. PipeDrive API is all JSON based. Does anyone know if I can make a URL to create a new lead or new person directly into pipedrive from the webform button? I've spent a few days looking at ViciDial API and PipeDrive API, but I honestly cannot figure it out.. I am newer to development and could use some assistance on how I can make this integration work.

Re: CRM API Integration

PostPosted: Thu Oct 20, 2022 4:45 am
by jamiemurray
A PHP script that you call using the webform button could easily convert the input in the GET parameters to a JSON string and submit that to the pipedrive API is a relatively simple undertaking with someone familiar with PHP.

I'd approach the script like this:
1. Ensure the request is valid (not already done and required information complete) and that there's some sort of security check especially if your vicidial is open to the internet (checking for a recent valid call id, validating against vicidial_users table etc).
2. Construct an array from the GET parameters and the other fields you want to fill with fixed values in PipeDrive.
3. Use json_encode() to convert the array to a json array.
4. Use curl to call the Pipedrive API and return the response.
5. Check for success and perhaps update the vendor_lead_code with the lead id from pipedrive and optionally redirect the user to that created lead in pipedrive.
6. If error, return a friendly message to the user explaining the error, (missing required info, already pushed to pipedrive etc)

I'd then use the webform or even dispo url to call that PHP script I created.