We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Apr 5, 2022 8:40 AM - edited Apr 5, 2022 8:42 AM
How often do the AssociationTypeIDs with category HUBSPOT_DEFINED
change? I wanna hardcode this AssociationTypeIDs, but i don't really sure about changings of this IDs.
Apr 5, 2022 10:08 AM
Hi @DParshenkov,
I think you should switch to the more recent associations v3 API instead of the legacy one.
From the V3 and onwards, you don't need to rely on the old associationTypeID.
Instead you use : fromObjectType, toObjectType in the endpoint URL as well as the "type" in the body.
You can hardcode these parameters as the native objects surely won't have their type change in the future.
Hope this helps, and if it does, please consider marking this as a solution
Have a good day,
Ludwig
![]() | CTO @ Mi4 Hubspot Platinum Partner and Integration Expert Passionate human, very curious about everything data and automation. Any problem with Hubspot you need help solving ? Let me know ! |
Apr 5, 2022 11:41 AM
Hi! I don't wanna create an association as entity Hubspot, i wanna create an association between call and companies or contact.
To do this, I need to pass:
CallId
ObjectId
associationTypeId, <---- Can i hardcode this param? Now i use 194 for call_to_contact and 182 for call_to_companie
ObjectType
Apr 5, 2022 12:38 PM
Hi @DParshenkov,
If you want to associate a call to a company or contact, you can still do it using the V3 of the API, so you won't need to rely on the type ID.
Associating a call to a contact would be made using a POST call to this endpoint :
/crm/v3/associations/Calls/Contacts/batch/create
And the body would look like this :
{
"inputs": [
{
"from": {
"id" : [id of your call]
},
"to" : {
"id" : [id of your contact]
},
"type": "call_to_contact"
}
]
}
And you would not use the deprecated endpoint relying on the objectTypeID.
Hope this helps,
Ludwig
![]() | CTO @ Mi4 Hubspot Platinum Partner and Integration Expert Passionate human, very curious about everything data and automation. Any problem with Hubspot you need help solving ? Let me know ! |