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,