APIs & Integrations

AJacob2
Participant

Can I use associations to deduplicate for API?

Basically, we are integrating information from our product into our Hubspot instance. New contacts and companies are to be created where they don't currently exist within Hubspot and updated where they do based on contacts signing up for our product.

 

What we want to ensure on the company's object is that we don't create duplicates. We are in an industry where the domain name for companies is not unique. As this process starts with someone signing up to the product, there isn't a Hubspot record ID on-hand that we can cross reference.

 

Our idea is that we could somehow utilize an existing association to company - where if a contact already exists and is associated with a company, assume that company is the company we are looking to update so don't create a new one. Has anyone done this previously or seen a different methodology to achieve this goal?

0 Upvotes
3 Replies 3
weiliang_lee
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Can I use associations to deduplicate for API?

Hey @Jaycee_Lewis thanks for the tag as always!

Hi @AJacob2 if I understand correctly, you are saying that a company with abc.com and xyz.com could potentially be the same company. How about this, as what Jaycee suggested, say you create custom property that you can uniquely identify the company as. Then on the property level you can choose this newly launched function:

weiliang_lee_0-1678326039538.png

In this case whenever you attempt to add a company with that field, it will dedup itself. 

 

The other alternative, if you would like more control over the logic, is to use the Search endpoint. From the section "Searching through associations", you'd see this chunk of code:

curl https://api.hubapi.com/crm/v3/objects/tickets/search \
  --request POST \          
  --header "Content-Type: application/json" \
  --data '{
    "filters": [
      {
        "propertyName": "associations.contact",
        "operator": "EQ",
        "value": "123"
      }
    ]
  }'

 

This means you could do a call to /v3/objects/company/search and use associations.contact as the propertyName. Once you fetch this company in particular, then you could do another call to PATCH
/crm/v3/objects/companies/{companyId}. 

 

Let me know if this solves your use case! Happy to brainstorm further.

 

Cheers

WL

 

0 Upvotes
AJacob2
Participant

Can I use associations to deduplicate for API?

Hi @weiliang_lee 

 

I appreciate your insight here. So the use case is that more than 1 company could have the same domain xyz.com and because there is a strong likelihood that a company comes into Hubspot first in terms of a lead and then becomes a product signup (by nature that their primary contact does those things), we are trying to figure out the best way of creating an identifier that can be used on product signup/Hubspot creation that would let us know not to create the duplicate.

I may be misreading here (apologies if so, my technical skillset isn't as strong), the piece that is crucial is that there is something unique on the Hubspot-created object and the potential endpoint-created object that would allow us to match and say update this versus create a new object. Our difficulty is being able to recognize something on the API created object that would match - ie how would we know that Company X with custom property field 01 is the same Company that we are creating via endpoint? 

The initial idea on associations is that sharing the same contact which is much easier to deduplicate and that could be that identifier as Company A with xyz.com and Company B with XYZ.com would in our instance have the same contact.

Thanks,

AJacob

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Can I use associations to deduplicate for API?

Hi, @AJacob2 👋 Thanks for reaching out. Let's tag some community members to get the conversation going. Hey, @weiliang_lee @Gonzalo @nikodev, do you have any thoughts on how @AJacob2 might approach this? I wonder if there is some combination of a custom company property with unique values enabled plus the Search API that might get them closer. And I will defer to your collective brilliance 😊

 

Best,

Jaycee


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes