crm-associations/v1 issue with custom object

Hi,

I face an issue when i use the V1 api to create an association between a native hubspot’s object and a custom one through a USER_DEFINED associaiton.

Here my code :

url = "https://api.hubapi.com/crm-associations/v1/associations/create-batch"
payload = "[{\"category\":\"USER_DEFINED\",\"definitionId\":35,\"fromObjectId\":375480052,\"toObjectId\":5949936630}]"

headers = {
 'accept': "application/json",
 'content-type': "application/json", 
 'authorization': "Bearer %MyToken%"
 }

response = requests.request("PUT", url, data=payload, headers=headers)

print(response.text)

unfortunately i receive this error message :

{
 "status":"error",
 "message":"Invalid input JSON on line 1, column 95: Only HUBSPOT_DEFINED associations are allowed",
 "correlationId":"d8b64b8b-9d52-474d-8108-aa9d1cddf163"
}

“Only HUBSPOT_DEFINED associations are allowed”

Is this a known limit from the version 1 ?

Juste to make sure my parameters are corrrect, it’s work well with the v4 (unfortunatley i HAVE to use the V1 in my case :/) :

url = "https://api.hubapi.com/crm/v4/objects/p26084605_point_de_vente/375480052/associations/company/5949936630"
payload = "[{\"associationCategory\":\"USER_DEFINED\",\"associationTypeId\":35}]"

headers = {
 'accept': "application/json",
 'content-type': "application/json", 
 'authorization': "Bearer %MyTokenAgain%"
 }

response = requests.request("PUT", url, data=payload, headers=headers)

print(response.text)

Thank you in advance for your answer !

Antoine,

Hey, @AOLIVIER0 :waving_hand: Thanks for reaching out. My experience says you are correct. This is likely due to the v1 endpoint being created and implemented before custom objected were rolled out. I am making an educated guess, that is why you can make it work with the v4 version. I will check with my internal resources and follow up here if I get an update for us.

Best,

Jaycee

Hi Jaycee,

Thank you for your answer :slightly_smiling_face:

The reason behind is because we use a SSIS connector (KingswaySoft) to communicate with Hubspot and unfortunatalty the actual connector’s version use the API V1 to operate.

I already contact kingswaysoft’s support and now i waiting for an update from them.

Thanks again and i wish you all the best for the future.

Best regard,

Antoine