I created a contact and merge that contact in Hubspot.
When I tried to get contact module data by using API, I am getting two contacts with different 'vid', but the same 'canonical-vid'. But getting two records of the contact in Hubspot API.
But there is only one record in Hubspot after merged contact.
I've had the same issue, when trying to pull all contacts I get some duplicates, and you can't just filter out any that have mismatched vid and cannonical-vid because that will remove some that aren't duplicates. I've added a check to add to my array those canonical-vids that aren't already in my array, which gives me the complete, non-duplicate list of contacts. example:
if (vids.includes(canonicalvid)) {
Logger.log(vid+' '+canonicalvid);
} else {
contacts.push([/*your hubspot data here*/]);
vids.push(canonicalvid)
}
Hi, @sandhiyadoss👋 Thanks for reaching out. Can you provide any additional details, code snippets, or screenshots to help provide our community with additional information, please?
In this case, having the following will be helpful for the community:
the specific endpoint you are using
an example Response
how did you perform the merge — did you do the merge in-app?
I've had the same issue, when trying to pull all contacts I get some duplicates, and you can't just filter out any that have mismatched vid and cannonical-vid because that will remove some that aren't duplicates. I've added a check to add to my array those canonical-vids that aren't already in my array, which gives me the complete, non-duplicate list of contacts. example:
if (vids.includes(canonicalvid)) {
Logger.log(vid+' '+canonicalvid);
} else {
contacts.push([/*your hubspot data here*/]);
vids.push(canonicalvid)
}