"Associated company" is not listed as a deal property.

VDrigin
Participant

I am trying to use API to access deal properties, using the following:

"https://api.hubapi.com/deals/v1/deal/paged?&properties=dealname&properties=dealstage&"

However, when I look up internal names using:

https://api.hubapi.com/properties/v1/deals/properties/?hapikey=demo

The property called "Associated company" is not listed.

3 Replies 3
himanshurauthan
Recognized Expert | Platinum Partner

Hi @VDrigin,

 

It seems like you want to fetch the associated company of the deal, if yes then you have to add association as a company in the request as associated companies are not stored in company properties.

 

For more details please check - https://developers.hubspot.com/docs/api/crm/deals in the endpoints tab - /crm/v3/objects/deals/{dealId}

 

 

Hope this helps!

 

Regards,

Digital Marketing & Inbound Expert In Growth Hacking Technology
VDrigin
Participant

Thank you,

But is there a way to get all the deals with all the coresponding assocations?

/crm/v3/objects/deals/{dealId}

As {dealId} imples that it would get the assocation only for a specific deal.

Thanks!

ASilva8
Participant | Partner

hey @VDrigin!

 

You can use endpoint method POST:
https://api.hubapi.com/crm/v3/objects/deal/search/?hapikey=your_api_hubspot

you will need the contact id to do this search.

Below is a json format to be included in the body of your request:

 

 

 

{
    "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "associations.contact",
          "operator": "EQ",
          "value": 10956601
        }
      ]
    }
  ]
}

 

 

 

to list all companies associated with a business you can use:

https://api.hubapi.com/crm/v3/objects/company/search/?hapikey=demo

 

you will need the deal id to do this search.

Below is a json format to be included in the body of your request:

 

 

{
    "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "associations.deal",
          "operator": "EQ",
          "value": 5633840463
        }
      ]
    }
  ]
}

 

 

you can also use the same method to search for tickets, companies, etc...

just change the type of object to be fetched:

https://api.hubapi.com/crm/v3/objects/{{deal,contact, tickets}}/search/?hapikey=your_api_hubspot

 

you can see more about it in the documentation: https://developers.hubspot.com/docs/api/crm/search

0 Upvotes