APIs & Integrations

TZiesing
Contributor

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 Upvotes
1 Reply 1
samrong_tee
Member | Diamond Partner
Member | Diamond Partner

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.

0 Upvotes