APIs & Integrations

WaydeChristie1
Contributor

Creating associations using unique ID values

Hi folks,

 

We can't store Hubspot IDs for our contacts or deals in our ERP system.

 

I've learned it's possible to use our own ID in place of a Hubspot ID, and this would make life a lot easier for us. More info on this page under "Unique identifiers and record IDs" heading.

 

Using this unique property ID, we're able to use our own internal ID for deal API requests, like this: GET https://api.hubapi.com/crm/v3/objects/deals/123456?idProperty=custom_unique_deal_property . This returns the deal where custom_unique_deal_property=123456.

 

The same can be done for contacts like this: GET https://api.hubapi.com/crm/v3/objects/contacts/name@email.com?idProperty=email

 

I'm wondering if we can use this same technique using associations endpoints?

 

We need to associate deals to contacts and we're unable to store Hubspot IDs for either.

 

This is the deals association endpoint:

 

https://api.hubapi.com/crm/v3/objects/deals/{dealId}/associations/{toObjectType}/{toObjectId}/{associationType}

 

Can we use our unique IDs somehow like this:

 

https://api.hubapi.com/crm/v3/objects/deals/123456/associations/contacts/name@email.com/deal_to_contact?idProperty=custom_unique_deal_property

 

Essentially this is trying to associate our own internal deal ID with a contact via their email address.

 

Can this be done?

 

Thanks in advance.

0 Upvotes
3 Replies 3
Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Creating associations using unique ID values

Hi @WaydeChristie1 ,

 

I do not see the ?idProperty as a parameter available in the docs. Might have to wait for a HubSpot employee to verify, but I think it is not possible.

Did you write the functionality yourself? If so, you could create a more complex solution by first retrieving the deal with your unique property and storing the HubSpot ID and doing the same for the contact. When you have both the ID's of the records you need, you could set the association. 

So the solution would be that you make two requests to retrieve the HubSpot Deal ID and the HubSpot Contact ID before setting the association.



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


WaydeChristie1
Contributor

Creating associations using unique ID values

Thanks Teun,

 

If you search for "Unique identifiers and record IDs" on this page you'll find everything I've mentioned.

 

It's not something I've developed, it's core Hubspot functionality.

 

I can't store Hubspot IDs in my ERP.

 

Hubspot supports creating your own unique IDs but then the support for using those IDs with the API seems limited.

 

0 Upvotes
Catinodeh
Member

Creating associations using unique ID values

I know this is "old" but did you have any success, @WaydeChristie1 ? I wonder if you had to query both objects and then create the association. 

0 Upvotes