APIs & Integrations

RAraujo0
Miembro

Is it possible to associate an object using a custom property?

resolver

Is is possible to associate an object to another through association api using a custom property instead of the hs_object_id?

 

/crm/v4​/objects​/{fromObjectType}​/{fromObjectId}​/associations​/default​/{toObjectType}​/{toObjectId}

 

This "fromObjectId" and "toObjectId" needs to be the hs_object_id or can be a custom property?

0 Me gusta
1 Soluciones aceptada
SteveHTM
Solución
Asesor destacado

Is it possible to associate an object using a custom property?

resolver

The API URL is contstructed as you suggest (in Python for example):

"https://api.hubapi.com/crm/v4/objects/" + ContactType + "/" + str(ContactId) + "/associations/" + CompanyType + "/" + str(CompanyId)

 

But if you have a custom object type, you substitute that type identifier and Object ID for one or both of these inserted value pairs. Clearly the ID in question is the HubSpot object ID for whatever type of object - however you have obtained that value previously. It could be hard coded or a value from another property - its just a digit string.

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature

Ver la solución en mensaje original publicado

0 Me gusta
3 Respuestas 3
SteveHTM
Asesor destacado

Is it possible to associate an object using a custom property?

resolver

@RAraujo0 - perhaps i'm misunderstanding your question, but using that API any hard coded value or property value can be used to pass the hubspot id value for the two objects you are trying to associate, Just make sure that the association ID is defined for the relationship between the objects.

 

Hope that helps.

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature
0 Me gusta
RAraujo0
Miembro

Is it possible to associate an object using a custom property?

resolver

My question is: to associate a contact to a company for example, can I use a custom property as the ID or it always need to be the main ID from contact?

/crm/v4​/objects​/contacts​/{mainID or custom property as ID?}​/associations​/default​/companies/{mainID or custom property as ID?}

0 Me gusta
SteveHTM
Solución
Asesor destacado

Is it possible to associate an object using a custom property?

resolver

The API URL is contstructed as you suggest (in Python for example):

"https://api.hubapi.com/crm/v4/objects/" + ContactType + "/" + str(ContactId) + "/associations/" + CompanyType + "/" + str(CompanyId)

 

But if you have a custom object type, you substitute that type identifier and Object ID for one or both of these inserted value pairs. Clearly the ID in question is the HubSpot object ID for whatever type of object - however you have obtained that value previously. It could be hard coded or a value from another property - its just a digit string.

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature
0 Me gusta