What is associationType for associate a custom object record with another custom object record

Hi,
I have created two custom objects first is “Listing Collateral” and the second is “Listing”. I want to Associate a custom object record with another custom object record, in my case “Listing Collateral” record associate with the “Listing” object record.

I’m using the following API and added respected values.
“https://api.hubapi.com/crm/v3/objects/objectType/objectId/associations/toObjectType/toObjectId/associationType?paginateAssociations=false&hapikey=YOUR_HUBSPOT_API_KEY”

While making an API call, the request is failed because of an invalid association type
I’m referring to the following link for the association type table but their not mention about association type for Associate a custom object with another custom object

association type table - Accounts Dashboard | HubSpot

so my question is what should I add the value of “associationType” ?

Hey @saranglad786 !

Welcome to the Community!

I have not actually attempted this, yet, but looking at the docs, it looks like you need to create that association definition (scroll down to New Association Definition). You should get a response with an ID that you can then use as the associationType.

Hello, I have the same problem.

Do you have any progress?
Thanks in advance

Hi,
I have gotten the association type and same API was successful thanks to @dennisedson.

Dear @GMontiel, you should first associate between existing two objects manually and then call following API with get request -

https://api.hubapi.com/crm/v3/objects/objectType/objectId/associations/toObjectTy

Refer this official link for more information.

After successful of API call request then you shall get List associations of an object by type. You should get “Type” from response of API call and copy the type value.

example -

now, try with new records “Associate an object with another object” API call as following - https://api.hubapi.com/crm/v3/objects/objectType/objectId/associations/toObjectType/toObjectId/associationType

and add respected values and associationType replace with your type (as you already copy that value).

in my case API should be - https://api.hubapi.com/crm/v3/objects/p8688041_listing_collateral/41112392/associations/p8611041_Listings/13456543/listing_collateral_to_listing

Thanks

Thanks @saranglad786, Finally works!