A way to fetch the latest added records for Persons, Organisation and Deals Modules

We are from Vtiger CRM. We are trying to write an integration with Pipedrive to enable sync between our product and Pipedrive. With the help of your API reference we were able to pull records from Persons, Organisation and Deals. But we found a problem with get all records. For instance

  1. We have 10 records of persons in Pipedrive account

  2. Every pull request would get the records , so here our product would get 10 records to create at our end in the first attempt of sync

  3. If we create a new person’s record at Pipedrive end

  4. When we try to sync it gets all records from persons module.

Our requirement is to fetch newly created records, updated and deleted records from Persons, Organisation and Deals Modules.

1 Like

Welcome to the community @kiriti_GB ! :slight_smile:
Your workflow is very detailed and helps me understand the scenario. In a nutshell, I see that you only want to sync what’s new / recently changed than polling all records?

Using webhooks you can listen to creation and update events on certain entities. This way, Pipedrive calls your API (event-driven) and is better than polling. Have you already considered this approach?

1 Like

Thank you for the response , I will try to use webhook and see if that would be a feasible approach for the integration.

1 Like

Hey, I have tried the approach you were referring to and that approach is not actually a fit for our integration. Also I noticed that when I delete all organizations and the screen shows no organizations added yet and then I try to fetch organizations data , it gives gives few organizations data which were already deleted and also has no value to differentiate between deleted as well as non deleted organizations. Is there any way to get only active Organizations from the end point.

Hey @kiriti_GB
Can you elaborate on the approach that you tried? Maybe we can start from there

This is strange. Ideally, when you delete an organization, it does not appear in the get all organization list (Pipedrive API v1 Reference)

Let me know how you are accessing them

Hey @Hem thanks for the quick response, We actually have a generalised connector with which we could integrate with third party services. The approach you are telling is not feasible with our existing structure as the connector doesn’t have a listener.
Can you please help me with the Organizations issue , here are the screenshots regarding the issue.

Postman response
{
“success”: true,
“data”: [
{
“id”: 61,
“company_id”: 10271205,
“owner_id”: 0,
“name”: “new org pipe drive end”,
“open_deals_count”: 0,
“related_open_deals_count”: 0,
“closed_deals_count”: 0,
“related_closed_deals_count”: 0,
“email_messages_count”: 0,
“people_count”: 0,
“activities_count”: 0,
“done_activities_count”: 0,
“undone_activities_count”: 0,
“files_count”: 0,
“notes_count”: 0,
“followers_count”: 1,
“won_deals_count”: 0,
“related_won_deals_count”: 0,
“lost_deals_count”: 0,
“related_lost_deals_count”: 0,
“active_flag”: true,
“category_id”: null,
“picture_id”: null,
“country_code”: null,
“first_char”: “n”,
“update_time”: “2021-11-29 10:23:57”,
“add_time”: “2021-11-29 10:23:57”,
“visible_to”: “3”,
“next_activity_date”: null,
“next_activity_time”: null,
“next_activity_id”: null,
“last_activity_id”: null,
“last_activity_date”: null,
“label”: null,
“address”: null,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: “”,
“address_sublocality”: “”,
“address_locality”: “”,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: “”,
“address_postal_code”: “”,
“address_formatted_address”: null,
“owner_name”: “”,
“cc_email”: “vtiger-sandbox@pipedrivemail.com
},
{
“id”: 62,
“company_id”: 10271205,
“owner_id”: 0,
“name”: “Vtiger”,
“open_deals_count”: 0,
“related_open_deals_count”: 0,
“closed_deals_count”: 0,
“related_closed_deals_count”: 0,
“email_messages_count”: 0,
“people_count”: 1,
“activities_count”: 0,
“done_activities_count”: 0,
“undone_activities_count”: 0,
“files_count”: 0,
“notes_count”: 0,
“followers_count”: 1,
“won_deals_count”: 0,
“related_won_deals_count”: 0,
“lost_deals_count”: 0,
“related_lost_deals_count”: 0,
“active_flag”: true,
“category_id”: null,
“picture_id”: null,
“country_code”: null,
“first_char”: “v”,
“update_time”: “2022-01-07 12:38:24”,
“add_time”: “2021-11-29 10:23:57”,
“visible_to”: “3”,
“next_activity_date”: null,
“next_activity_time”: null,
“next_activity_id”: null,
“last_activity_id”: null,
“last_activity_date”: null,
“label”: null,
“address”: null,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: “”,
“address_sublocality”: “”,
“address_locality”: “”,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: “”,
“address_postal_code”: “”,
“address_formatted_address”: null,
“owner_name”: “”,
“cc_email”: “vtiger-sandbox@pipedrivemail.com
},
{
“id”: 63,
“company_id”: 10271205,
“owner_id”: 0,
“name”: “Testing Org”,
“open_deals_count”: 0,
“related_open_deals_count”: 0,
“closed_deals_count”: 0,
“related_closed_deals_count”: 0,
“email_messages_count”: 0,
“people_count”: 0,
“activities_count”: 0,
“done_activities_count”: 0,
“undone_activities_count”: 0,
“files_count”: 0,
“notes_count”: 0,
“followers_count”: 1,
“won_deals_count”: 0,
“related_won_deals_count”: 0,
“lost_deals_count”: 0,
“related_lost_deals_count”: 0,
“active_flag”: true,
“category_id”: null,
“picture_id”: null,
“country_code”: null,
“first_char”: “t”,
“update_time”: “2021-11-29 10:23:58”,
“add_time”: “2021-11-29 10:23:58”,
“visible_to”: “3”,
“next_activity_date”: null,
“next_activity_time”: null,
“next_activity_id”: null,
“last_activity_id”: null,
“last_activity_date”: null,
“label”: null,
“address”: null,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: “”,
“address_sublocality”: “”,
“address_locality”: “”,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: “”,
“address_postal_code”: “”,
“address_formatted_address”: null,
“owner_name”: “”,
“cc_email”: “vtiger-sandbox@pipedrivemail.com
},
{
“id”: 64,
“company_id”: 10271205,
“owner_id”: 0,
“name”: “Apple I Station 2”,
“open_deals_count”: 0,
“related_open_deals_count”: 0,
“closed_deals_count”: 0,
“related_closed_deals_count”: 0,
“email_messages_count”: 0,
“people_count”: 0,
“activities_count”: 0,
“done_activities_count”: 0,
“undone_activities_count”: 0,
“files_count”: 0,
“notes_count”: 0,
“followers_count”: 1,
“won_deals_count”: 0,
“related_won_deals_count”: 0,
“lost_deals_count”: 0,
“related_lost_deals_count”: 0,
“active_flag”: true,
“category_id”: null,
“picture_id”: null,
“country_code”: null,
“first_char”: “a”,
“update_time”: “2021-11-29 10:23:59”,
“add_time”: “2021-11-29 10:23:59”,
“visible_to”: “3”,
“next_activity_date”: null,
“next_activity_time”: null,
“next_activity_id”: null,
“last_activity_id”: null,
“last_activity_date”: null,
“label”: null,
“address”: null,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: “Kukatpally Housing Board Road”,
“address_sublocality”: “Kukatpally”,
“address_locality”: “”,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: “”,
“address_postal_code”: “500085”,
“address_formatted_address”: null,
“owner_name”: “”,
“cc_email”: “vtiger-sandbox@pipedrivemail.com
},
{
“id”: 65,
“company_id”: 10271205,
“owner_id”: 0,
“name”: “Testing Org2”,
“open_deals_count”: 0,
“related_open_deals_count”: 0,
“closed_deals_count”: 0,
“related_closed_deals_count”: 0,
“email_messages_count”: 0,
“people_count”: 0,
“activities_count”: 0,
“done_activities_count”: 0,
“undone_activities_count”: 0,
“files_count”: 0,
“notes_count”: 0,
“followers_count”: 1,
“won_deals_count”: 0,
“related_won_deals_count”: 0,
“lost_deals_count”: 0,
“related_lost_deals_count”: 0,
“active_flag”: true,
“category_id”: null,
“picture_id”: null,
“country_code”: null,
“first_char”: “t”,
“update_time”: “2021-11-29 10:23:59”,
“add_time”: “2021-11-29 10:23:59”,
“visible_to”: “3”,
“next_activity_date”: null,
“next_activity_time”: null,
“next_activity_id”: null,
“last_activity_id”: null,
“last_activity_date”: null,
“label”: null,
“address”: null,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: “Geraldton Grove”,
“address_sublocality”: “”,
“address_locality”: “”,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: “”,
“address_postal_code”: “6168”,
“address_formatted_address”: null,
“owner_name”: “”,
“cc_email”: “vtiger-sandbox@pipedrivemail.com
},
{
“id”: 66,
“company_id”: 10271205,
“owner_id”: 0,
“name”: “Hello World”,
“open_deals_count”: 0,
“related_open_deals_count”: 0,
“closed_deals_count”: 0,
“related_closed_deals_count”: 0,
“email_messages_count”: 0,
“people_count”: 0,
“activities_count”: 0,
“done_activities_count”: 0,
“undone_activities_count”: 0,
“files_count”: 0,
“notes_count”: 0,
“followers_count”: 1,
“won_deals_count”: 0,
“related_won_deals_count”: 0,
“lost_deals_count”: 0,
“related_lost_deals_count”: 0,
“active_flag”: true,
“category_id”: null,
“picture_id”: null,
“country_code”: null,
“first_char”: “h”,
“update_time”: “2021-11-29 10:24:00”,
“add_time”: “2021-11-29 10:23:59”,
“visible_to”: “3”,
“next_activity_date”: null,
“next_activity_time”: null,
“next_activity_id”: null,
“last_activity_id”: null,
“last_activity_date”: null,
“label”: null,
“address”: null,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: “Kukatpally Housing Board Road”,
“address_sublocality”: “Kukatpally”,
“address_locality”: “”,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: “”,
“address_postal_code”: “500085”,
“address_formatted_address”: null,
“owner_name”: “”,
“cc_email”: “vtiger-sandbox@pipedrivemail.com
},
{
“id”: 67,
“company_id”: 10271205,
“owner_id”: 0,
“name”: “Random Dev Org”,
“open_deals_count”: 0,
“related_open_deals_count”: 0,
“closed_deals_count”: 0,
“related_closed_deals_count”: 0,
“email_messages_count”: 0,
“people_count”: 0,
“activities_count”: 0,
“done_activities_count”: 0,
“undone_activities_count”: 0,
“files_count”: 0,
“notes_count”: 0,
“followers_count”: 1,
“won_deals_count”: 0,
“related_won_deals_count”: 0,
“lost_deals_count”: 0,
“related_lost_deals_count”: 0,
“active_flag”: true,
“category_id”: null,
“picture_id”: null,
“country_code”: null,
“first_char”: “r”,
“update_time”: “2021-11-29 10:24:00”,
“add_time”: “2021-11-29 10:24:00”,
“visible_to”: “3”,
“next_activity_date”: null,
“next_activity_time”: null,
“next_activity_id”: null,
“last_activity_id”: null,
“last_activity_date”: null,
“label”: null,
“address”: null,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: “”,
“address_sublocality”: “”,
“address_locality”: “”,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: “”,
“address_postal_code”: “”,
“address_formatted_address”: null,
“owner_name”: “”,
“cc_email”: “vtiger-sandbox@pipedrivemail.com
},
{
“id”: 68,
“company_id”: 10271205,
“owner_id”: 0,
“name”: “New ORG”,
“open_deals_count”: 0,
“related_open_deals_count”: 0,
“closed_deals_count”: 0,
“related_closed_deals_count”: 0,
“email_messages_count”: 0,
“people_count”: 0,
“activities_count”: 0,
“done_activities_count”: 0,
“undone_activities_count”: 0,
“files_count”: 0,
“notes_count”: 0,
“followers_count”: 1,
“won_deals_count”: 0,
“related_won_deals_count”: 0,
“lost_deals_count”: 0,
“related_lost_deals_count”: 0,
“active_flag”: true,
“category_id”: null,
“picture_id”: null,
“country_code”: null,
“first_char”: “n”,
“update_time”: “2021-11-29 10:24:01”,
“add_time”: “2021-11-29 10:24:01”,
“visible_to”: “3”,
“next_activity_date”: null,
“next_activity_time”: null,
“next_activity_id”: null,
“last_activity_id”: null,
“last_activity_date”: null,
“label”: null,
“address”: null,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: “”,
“address_sublocality”: “”,
“address_locality”: “”,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: “”,
“address_postal_code”: “”,
“address_formatted_address”: null,
“owner_name”: “”,
“cc_email”: “vtiger-sandbox@pipedrivemail.com
},
{
“id”: 69,
“company_id”: 10271205,
“owner_id”: 0,
“name”: “Random Org”,
“open_deals_count”: 0,
“related_open_deals_count”: 0,
“closed_deals_count”: 0,
“related_closed_deals_count”: 0,
“email_messages_count”: 0,
“people_count”: 0,
“activities_count”: 0,
“done_activities_count”: 0,
“undone_activities_count”: 0,
“files_count”: 0,
“notes_count”: 0,
“followers_count”: 1,
“won_deals_count”: 0,
“related_won_deals_count”: 0,
“lost_deals_count”: 0,
“related_lost_deals_count”: 0,
“active_flag”: true,
“category_id”: null,
“picture_id”: null,
“country_code”: null,
“first_char”: “r”,
“update_time”: “2021-11-29 10:24:02”,
“add_time”: “2021-11-29 10:24:01”,
“visible_to”: “3”,
“next_activity_date”: null,
“next_activity_time”: null,
“next_activity_id”: null,
“last_activity_id”: null,
“last_activity_date”: null,
“label”: null,
“address”: null,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: “”,
“address_sublocality”: “”,
“address_locality”: “”,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: “”,
“address_postal_code”: “”,
“address_formatted_address”: null,
“owner_name”: “”,
“cc_email”: “vtiger-sandbox@pipedrivemail.com
},
{
“id”: 70,
“company_id”: 10271205,
“owner_id”: 0,
“name”: “New testing Sync org”,
“open_deals_count”: 0,
“related_open_deals_count”: 0,
“closed_deals_count”: 0,
“related_closed_deals_count”: 0,
“email_messages_count”: 0,
“people_count”: 0,
“activities_count”: 0,
“done_activities_count”: 0,
“undone_activities_count”: 0,
“files_count”: 0,
“notes_count”: 0,
“followers_count”: 1,
“won_deals_count”: 0,
“related_won_deals_count”: 0,
“lost_deals_count”: 0,
“related_lost_deals_count”: 0,
“active_flag”: true,
“category_id”: null,
“picture_id”: null,
“country_code”: null,
“first_char”: “n”,
“update_time”: “2021-11-29 10:24:03”,
“add_time”: “2021-11-29 10:24:02”,
“visible_to”: “3”,
“next_activity_date”: null,
“next_activity_time”: null,
“next_activity_id”: null,
“last_activity_id”: null,
“last_activity_date”: null,
“label”: null,
“address”: null,
“address_subpremise”: null,
“address_street_number”: null,
“address_route”: “”,
“address_sublocality”: “”,
“address_locality”: “”,
“address_admin_area_level_1”: null,
“address_admin_area_level_2”: null,
“address_country”: “”,
“address_postal_code”: “”,
“address_formatted_address”: null,
“owner_name”: “”,
“cc_email”: “vtiger-sandbox@pipedrivemail.com
}
],
“additional_data”: {
“pagination”: {
“start”: 0,
“limit”: 100,
“more_items_in_collection”: false
}
}
}

Can you please suggest a way to get only available organizations, instead of getting deleted organizations along with available organizations.

Thanks for sharing the screenshot @kiriti_GB

I want to rule out one possible way you are noticing this behavior. In the top right corner of organizations page, can you set the filter to Everyone? I currently see that it is listing organizations owned by you (which could be 0 because it was all deleted?)

Is there a chance that there are other owners who might have created these organizations (apart from you)?

On the other hand, I also see that the value for owner_id is 0.

@Hem Ya I could remove the organizations from everyone thanks for the response.

That is great. Glad you got it working :raised_hands: