We've just starting using the Contacts API and are putting a contact record into HubSpot when a new customer signs up.
Where the {New} Contact has the same email address as an existing contact record - the API doesn't appear to handle very well and we end up with two contact records - but with the identifying email address attached to the original not the {New} Contact. All contacts created by API should have an email address (as we collect in our db) but the record when pushed in doesn't display it.
My question: How can we merge these contacts via the API in a sensible way? Anyone came across or dealt with this situation before?
OK I found out what was wrong and it was a big oversight on my part. I knew that HubSpot uses email addresses as unique key fields but I was so sure that I had provided an email that I felt I did not need to check the code. Wrong! So, I updated the AWS ETL integration code making sure that the email was extracted from the csv file and then added to the python dictionry used to construct the pay oad for the HubSpot Contact API . This problem is solved because HubSpot now sends the erorr code 409 message indicating that a duplicate record was attempting to be inserted. It now functions the same way as Postman does for these scenarios.
@Derek_Gervais I am having the same issue except I am using AWS Lambda python code to POST contact records to a client's HubSpot server using the Contact API:
I put the csv file containing the records with emails, into the AWS FTP location and it posts the contact successfully to HubSpot.
I load the same file onto the AWS FTP location and it creates a duplicate.
I create a raw JSON Body string in Postman of the same data from the csv file.
I submit the POST method for this record and I get a 409 Error Code indicating this: