from the json response in the example the value “contact_to_company” is used. S
o yes, please go ahead and try “deal_to_company”
I don’t think there is gonna be a list of standardarized values for the association types that API v3 expects, basically it’s a “Discovery” like architecture.
I can’t tell you as I didn’t test but looking at your previous ticket,in case the plural version is working ( ‘deals_to_companies’ ), you could might give a try with
:
\HubSpot\Crm\ObjectType::DEALS . ‘_to_’ . HubSpot\Crm\ObjectType::COMPANIES (or something similar)
If anyone has a feedback or opinion on the subject, you are welcome to share it the community
{
"message":"[400] Client error: `PUT https://api.hubapi.com/crm/v3/objects/contacts/88141351/associations/companies/2410836413/contacts_to_companies?paginateAssociations=&hapikey=XXX` resulted in a `400 Bad Request`"
}
{
"response":{
"status":"error",
"message":"contacts_to_companies is not a valid association type between contacts and companies"
}
I manually changed the association type to “Contact_to_Company” and the API seemed to work.
It would be nice if we didn’t have to guess at the values for these undocumented constants.
The Associations API v3 has an endpoint that will allow you to query the system and ask what types of associations are available between a pair of CRM objects:
Please note that the association returned is direction specific. You can get the id and name of the association type going the other direction by swapping the