APIs & Integrations

horacioiseka
Member

How to ask for deal's associated company

SOLVE

Hi,
I'm getting a list of deals with my key but I cannot find any Deal related property to identify the associated company. And if I try using the example of the API I get following error:

 

'{"status":"error","message":"internal error","correlationId":"b3b14dbd-20eb-4ca4-8ba5-49074e69d711"}'

 

My code:  

 

url = "https://api.hubapi.com/crm/v3/associations/deals/company/batch/read"

querystring = {
    "hapikey":"MY-API-KEY"
}

headers = {'accept': 'application/json'}
querystring['after'] = '20'
payload = "{\"inputs\":[{\"id\":\"755245668\"}]}"
response = requests.request("POST", url, headers=headers, params=querystring)
data = response.text
data

 

 

On the other hand, I've seen in a previous post that someone found Company ID in the hs_object_id field, but the ID in this field is the same than the Deal ID, so: or the hs_object_id field in the Deal objects is not the company ID, or the company ID and the Deal ID are one and the same.

0 Upvotes
1 Accepted solution
horacioiseka
Solution
Member

How to ask for deal's associated company

SOLVE

Hi! I found the solution!
I just had to ask for "associations" in the query params:
"associations":"company".
And that's all! 
Thanks!

View solution in original post

6 Replies 6
horacioiseka
Solution
Member

How to ask for deal's associated company

SOLVE

Hi! I found the solution!
I just had to ask for "associations" in the query params:
"associations":"company".
And that's all! 
Thanks!

quentin_lamamy
Key Advisor | Diamond Partner
Key Advisor | Diamond Partner

How to ask for deal's associated company

SOLVE

@horacioisekaI have an idea but need to still work on it, i will try to answer when my test sandbox is finished.


quentin_lamamy
Key Advisor | Diamond Partner
Key Advisor | Diamond Partner

How to ask for deal's associated company

SOLVE

Ho @horacioiseka ,

I need to investigate, i will answer you this night (on Paris timezone) or tomorrow.


0 Upvotes
quentin_lamamy
Key Advisor | Diamond Partner
Key Advisor | Diamond Partner

How to ask for deal's associated company

SOLVE

Hi @horacioiseka ,

Just to be sure before answering to your issue. You want to list all yours deals and get for each deals a field with the comany id ?

 

hsSign_smaller.png


0 Upvotes
horacioiseka
Member

How to ask for deal's associated company

SOLVE

Hi @dennisedson, I didn't resolve the issue.
And Hi @Quentin ! That is exactly what I am asking for. Nonetheless, so far, my research points that there is no CompanyId field (or similar) when asking for deals. It seems than the only way to get the company associated to a deal is through the "Associations" query, asking for those companies associated with a Deal Id.
If someone knows a simpler way, I would be thankful!

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

How to ask for deal's associated company

SOLVE

Hey @horacioiseka 

Did you get this resolved? 

@quentin_lamamy , have you dealt with this before?

0 Upvotes