APIs & Integrations

RAraujo0
Membre

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

Résolue

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 Votes
1 Solution acceptée
SteveHTM
Solution
Conseiller clé

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

Résolue

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

Voir la solution dans l'envoi d'origine

0 Votes
3 Réponses
SteveHTM
Conseiller clé

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

Résolue

@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 Votes
RAraujo0
Membre

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

Résolue

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 Votes
SteveHTM
Solution
Conseiller clé

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

Résolue

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 Votes