Association deal - contact on Create Deal method V3
SOLVE
Hi all,
I'm tring to create a new deal, associated with a existing contact, via API using V3 documentation. But I can't find, in the V3 doc, a way to associate this new deal with the contact, at the moment of deal creation.
I recall that in V2 method, you have two indexes ("associations" and "properties"), where you can create and simultaneously, associate with one or more contacts.
Once created, we now use the Id generated in the response to add the association via the following request:
Example PUT URL:
https://api.hubapi.com/crm-associations/v1/associations?hapikey=demo
Example PUT JSON:
{
"fromObjectId": 496346,
"toObjectId": 176602,
"category": "HUBSPOT_DEFINED",
"definitionId": 15
}
To note, Associations are defined based on the type of objects being associated, and the direction of that association. Association definitions are unidirectional, so you'll use a different definition ID depending on which object type you're starting with.
Once created, we now use the Id generated in the response to add the association via the following request:
Example PUT URL:
https://api.hubapi.com/crm-associations/v1/associations?hapikey=demo
Example PUT JSON:
{
"fromObjectId": 496346,
"toObjectId": 176602,
"category": "HUBSPOT_DEFINED",
"definitionId": 15
}
To note, Associations are defined based on the type of objects being associated, and the direction of that association. Association definitions are unidirectional, so you'll use a different definition ID depending on which object type you're starting with.
Thanks for the reply. I figured out that 2-step process is the only way, according to the new API documentation.
But I don't think that is the best solution. Create a deal using the V2 documentation works fine... you can create a deal and at the same time, associate it with a contact, decreasing the numbers of requests made by a external application.
I realy don't understand why Hubspot is making this decision. For me this is a step-back move... Hubspot has a request limit per day/seconds... I believe this new version of Hubspot API's suppose to help developers decrease the numbers of requests... but instead, is increasing those numbers... I realy don't get it!
Association deal - contact on Create Deal method V3
SOLVE
It seems your documentation is updated again, so now it does take a single call with `properties` and `associations` again. But now this documentation is (in case of PHP) for the api-client v10, which is in beta, and there is no documentation to be found for v9...
So funny thing is, the v10 documentation works in v9, except the typehinting isn't supporting it, meaning that PHPStan or similar tools are crying that we're sending the wrong object..
Association deal - contact on Create Deal method V3
SOLVE
Had do register just to comment, it is incredible how a company as big as hubspot couldn't achiteture it so it would receive only one request.. . Well, it does make me feel a little assured, i can look at my code and don't feel as bad as i should 😂
Association deal - contact on Create Deal method V3
SOLVE
Hello,
Like @hilton22 stated, the ability to associate a an object with another upon its creation, in my case I want to associate a company with a deal when I create the company, is important to my business. Is there an update to this feature?