APIs & Integrations

TZiesing
Contributeur

Associate custom object to contact

Hi there, I am trying to set up an association between contact and custom object but I am wondering what the right "objecttype" would be? I assumed it would be the name of the custom object but it gives me an error. 

Does anyone has a hint what I am doing wrong in this regard?

Thanks

0 Votes
1 Réponse
samrong_tee
Membre | Partenaire solutions Diamond
Membre | Partenaire solutions Diamond

Associate custom object to contact

Hi TZiesing,

 

The Object type actually is the Custom Object Type ID. we can find from the Hubspot URL:

For example, navigate to Contacts > Custom Objects
In the Custom objects page click one of the object item it will redirect to this URL:
https://app.hubspot.com/contacts/23345688/record/2-8142271/3265131140/

23345688 is Instance ID
2-8142271 is Object type ID (this is the object type ID you are looking for)
3265131140 is Object ID

here is the example of request values for Association endpoint:
{
  fromObjectType: 'contact',
  fromObjectId: '6334451',
  toObjectType: '2-8142271',
  toObjectId: '3265131140',
  relationship: 'contact_to_custom_object'
}

hope can solve your issue.