Close.IO Legacy Hooks

node v10.15.3
version: 1.0.0
endpointsharetweet
let createUpdateHook = { "model": "lead", "event": "update", // "create" // the webhook collector just discards the rest of the data and uses only the id property from the data object "data": { "tasks": [ { "date_updated": "2019-02-27T18:50:53.581000+00:00", "text": "Check email", "object_type": "taskcompleted", "contact_id": null, "created_by": "user_JZwheRT9uACYFLiJC30vq4iaHQD97eJeHt72hPvwxkV", "lead_name": "BMF Solutions", "contact_name": null, "id": "task_5hERvZlpG0P5JfNVJflLWkdGsfY6cxW50B0wC5TTCa8", "object_id": "acti_5kLUGuXYsfN1OYM8yRrufehgeeNOrqPSEwHzNaS1kG7", "updated_by_name": "Nicholas Roa", "created_by_name": "Nicholas Roa", "is_dateless": false, "due_date": "2018-11-20T14:00:00+00:00", "_type": "lead", "updated_by": "user_JZwheRT9uACYFLiJC30vq4iaHQD97eJeHt72hPvwxkV", "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", "assigned_to_name": "Nicholas Roa", "date": "2018-11-20T14:00:00+00:00", "lead_id": "lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi", "assigned_to": "user_JZwheRT9uACYFLiJC30vq4iaHQD97eJeHt72hPvwxkV", "date_created": "2018-11-19T15:59:23.914000+00:00", "is_complete": true, "view": "archive" }, { "date_updated": "2017-09-06T14:12:27.216000+00:00", "text": "Follow up", "object_type": "taskcompleted", "contact_id": null, "created_by": "user_YBQaFRzQYQAbcA4PZAFqEba0iSkBjuGq2r9WRSpv8jv", "lead_name": "BMF Solutions", "contact_name": null, "id": "task_TGdlD6STYJSt0ZPGKVcouyKPUbAGFcXiT3kBmjPXIvq", "object_id": "acti_oAPcV7xKMKLYARVKuuSF9u7Ce3o0maPigtd1qJi423v", "updated_by_name": "Cassandra Charles", "created_by_name": "Cassandra Charles", "is_dateless": false, "due_date": "2017-09-06", "_type": "lead", "updated_by": "user_YBQaFRzQYQAbcA4PZAFqEba0iSkBjuGq2r9WRSpv8jv", "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", "assigned_to_name": "Cassandra Charles", "date": "2017-09-06", "lead_id": "lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi", "assigned_to": "user_YBQaFRzQYQAbcA4PZAFqEba0iSkBjuGq2r9WRSpv8jv", "date_created": "2017-09-05T15:32:18.550000+00:00", "is_complete": true, "view": "archive" }, { "date_updated": "2017-08-11T13:59:18.953000+00:00", "text": "LAST CALL", "object_type": "taskcompleted", "contact_id": null, "created_by": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "lead_name": "BMF Solutions", "contact_name": null, "id": "task_Rl6FrywgS9XLfowOPOiF80FHeGnbo4du2DkoJq6CnYl", "object_id": "acti_BXZOGUOoZetrZZx15UiSQKxVmVWXz7O1bUgh6WhZ87L", "updated_by_name": "Elgin Rich", "created_by_name": "Elgin Rich", "is_dateless": false, "due_date": "2017-08-15", "_type": "lead", "updated_by": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", "assigned_to_name": "Elgin Rich", "date": "2017-08-15", "lead_id": "lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi", "assigned_to": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "date_created": "2017-07-14T16:07:46.810000+00:00", "is_complete": true, "view": "archive" }, { "date_updated": "2017-07-14T16:07:31.144000+00:00", "text": "AE Demo", "object_type": "taskcompleted", "contact_id": null, "created_by": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "lead_name": "BMF Solutions", "contact_name": null, "id": "task_HsBYDOADCT2WC7VtcRuZsuMBLknQn4ZHRRqU8eG89Kc", "object_id": "acti_nNJu29Qwco5pvFNWvmD0cDHxnr0bG8dF0JsHSIohzH6", "updated_by_name": "Elgin Rich", "created_by_name": "Elgin Rich", "is_dateless": false, "due_date": "2017-07-14T15:30:00+00:00", "_type": "lead", "updated_by": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", "assigned_to_name": "Elgin Rich", "date": "2017-07-14T15:30:00+00:00", "lead_id": "lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi", "assigned_to": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "date_created": "2017-07-14T13:45:42.823000+00:00", "is_complete": true, "view": "archive" }, { "date_updated": "2017-07-13T21:13:02.530000+00:00", "text": "FU 3 - CALL", "object_type": "taskcompleted", "contact_id": null, "created_by": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "lead_name": "BMF Solutions", "contact_name": null, "id": "task_aJNEhVyjhBNv4Feg58MNpafS02fWOJpwIuiniOXg36E", "object_id": "acti_sfs1jAWw4WUO25OVI5uGnMUsUSmWyR3fr83RF1xdGA5", "updated_by_name": "Elgin Rich", "created_by_name": "Elgin Rich", "is_dateless": false, "due_date": "2017-07-13", "_type": "lead", "updated_by": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", "assigned_to_name": "Elgin Rich", "date": "2017-07-13", "lead_id": "lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi", "assigned_to": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "date_created": "2017-07-05T14:24:45.245000+00:00", "is_complete": true, "view": "archive" }, { "date_updated": "2017-07-05T14:24:41.363000+00:00", "text": "Follow up", "object_type": "taskcompleted", "contact_id": null, "created_by": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "lead_name": "BMF Solutions", "contact_name": null, "id": "task_qj7dUR8VvwkDbyR5tAc7qlFKuuVV7Bvc05GcYJ9jSsh", "object_id": "acti_U7gSy9mP7IAmAKEu7VpRYKoVkrasyE8ZLyDGnnoOKBh", "updated_by_name": "Elgin Rich", "created_by_name": "Elgin Rich", "is_dateless": false, "due_date": "2017-07-05", "_type": "lead", "updated_by": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", "assigned_to_name": "Elgin Rich", "date": "2017-07-05", "lead_id": "lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi", "assigned_to": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "date_created": "2017-07-05T14:24:39.758000+00:00", "is_complete": true, "view": "archive" }, { "date_updated": "2017-07-14T14:00:36.275000+00:00", "text": "no task", "object_type": "taskcompleted", "contact_id": null, "created_by": "user_JE8IvdxrQOrxb2Lu2ytNa5Rhoz3k4wF2HgoKjf0gqqJ", "lead_name": "BMF Solutions", "contact_name": null, "id": "task_nTzFgJ9eBc5BUQB7pXBeqauzRbGbRqYUx7SccsaajHJ", "object_id": "acti_pYNgf993G9YQnQuVFDwP5nJkp4letwQaWTLdZmisClX", "updated_by_name": "Elgin Rich", "created_by_name": "Tommy Lopez", "is_dateless": false, "due_date": "2017-06-06", "_type": "lead", "updated_by": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", "assigned_to_name": "Tommy Lopez", "date": "2017-06-06", "lead_id": "lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi", "assigned_to": "user_JE8IvdxrQOrxb2Lu2ytNa5Rhoz3k4wF2HgoKjf0gqqJ", "date_created": "2017-06-06T18:32:08.513000+00:00", "is_complete": true, "view": "archive" } ], "addresses": [], "date_updated": "2019-06-12T19:31:58.098000+00:00", "created_by_name": "Jeff Rubenstein", "custom.lcf_6qVOpIkjpfiBgBuYZbKdgnES8NMHLGNusEAFdgT3zzj": "https://govspend.app/spending?searchBarField=company&searchBarQuery=BMF%20Solutions", "opportunities": [], "id": "lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi", "description": "", "display_name": "BMF Solutions", "contacts": [ { "display_name": "William Hoft", "updated_by": "user_LVn2keSHjkUPkcckEfNl0ZRHtjmZNVAivIEG0eLIViK", "name": "William Hoft", "title": "", "date_updated": "2017-07-14T14:00:35.959000+00:00", "phones": [ { "country": "US", "phone_formatted": "+1 832-220-1500", "type": "office", "phone": "+18322201500" }, { "country": "US", "phone_formatted": "+1 713-289-0344", "type": "mobile", "phone": "+17132890344" } ], "created_by": "user_sHLWvgRAI2ketE0ytGBzgyVyHPBodADATytNUmBRkZ9", "id": "cont_R2IV1Tqx1UhTRHOo2qjbTxunm0uCZOyNP9NrKe3MnGx", "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", "urls": [], "date_created": "2017-07-03T19:47:50.423000+00:00", "integration_links": [], "emails": [ { "type": "office", "email": "[email protected]" } ], "lead_id": "lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi" } ], "created_by": "user_BGEwBh36zfu8BFf2LOPjQxhh8bekDUClBJeBwBCEsfS", "custom": { "Lead Source_old": "SP Web - Mktg Email - Verify your profile - free", "Alpha": "BM", "Search": "https://govspend.app/spending?searchBarField=company&searchBarQuery=BMF%20Solutions", "Lead Source": "SP Web - Mktg Email - Verify your profile - free" }, "updated_by_name": "Admin User", "custom.lcf_8F7pQJ1GMkjgoa7uH6y0q8EMQ93W8hI63sJUEraLMED": "SP Web - Mktg Email - Verify your profile - free", "custom.lcf_ajMlHrakHguZi4iRDxGY30AhoOZOLWiQwgtIszvGfHo": "BM", "updated_by": "user_sHLWvgRAI2ketE0ytGBzgyVyHPBodADATytNUmBRkZ9", "status_id": "stat_7dYE2upWVYkIN7F1XFwVfIKx19qJODUj7So6zdMMOby", "html_url": "https://app.close.com/lead/lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi/", "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", "custom.lcf_d1Is8ozcRhKEMlFirCm35XQHEzlfpO9Jbfv4GRjTbsS": "SP Web - Mktg Email - Verify your profile - free", "integration_links": [ { "url": "http://app.govquote.us/admin/closeio/lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi", "name": "_Manage GovQuote Account" }, { "url": "https://govspend.app/manageorganization/lead_YkFo9M9tZ01T4IWUvXHNg3gBXmX7uZw9NwmfxZoxaRi?idType=closeio&name=BMF%20Solutions&status=Open", "name": "_Manage GovSpend Account" } ], "name": "BMF Solutions", "url": "http://www.bmfsolutions.com", "status_label": "Open", "date_created": "2017-05-18T19:27:35.053000+00:00" } } let deleteHook = { "model": "lead", "event": "delete", "data": { // lead being deleted "id": "lead_dJJIhhoBDyj3JTv1RQLodLUeCgqNlPsXmAN9oQiHOpK", // close.io organization to which the lead belongs "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", // the close.io user that did the lead deletion "user_id": "user_ebgg8BE9o6maxRaxJUgnDSFrqXxA9k6MD0xkGgsQXgs" } } let mergeHook = { "model": "lead", "event": "merge", "data": { "organization_id": "orga_9tdSwqCXlR7UUfD89wfYFmDh3UV0Nj46FkD4HV0V39C", "user_id": "user_ebgg8BE9o6maxRaxJUgnDSFrqXxA9k6MD0xkGgsQXgs", // this is the lead that is beling deleted and merged into the destination lead "source_id": "lead_dJJIhhoBDyj3JTv1RQLodLUeCgqNlPsXmAN9oQiHOpK", "destination_id": "lead_bSmFsB1tUYpnZvuwyAYQIl2hxEW48owsuCbSc4Ob97m" } }
Loading…

no comments

    sign in to comment