APIs & Integrations

Rintegration
Member

[deals] Find associated company id

SOLVE

hello guys, 
i went throguh the API doc but could not find an answer to my question: what's the property name of associated company id in the GET deals endpoint? I tried with associatedcompanyids but it seems does not work. By default HS returns the object id, which i think refers to the deal. 

Would be extremely thankful if someone could help me with this matter

Have a great day

0 Upvotes
1 Accepted solution
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

[deals] Find associated company id

SOLVE

Hi @Rintegration,

 

When making the API call to the GET deal endpoint, you need to add an "associations" parameter and include the object type ID you want to get the associations for.

 

For example, if you would like to get the associated Company ID of a specific deal, you would make this API call:

 

 

https://api.hubapi.com/crm/v3/objects/deals/{dealId}?associations=0-2

 

 

(0-2 corresponds to the Company object type)

 

Then in the response body, the associations would show up in this format:

 

 

"associations": {
        "companies": {
            "results": [
                {
                    "id": "1234567890",
                    "type": "deal_to_company"
                },
                {
                    "id": "1234567890",
                    "type": "deal_to_company_unlabeled"
                }
            ]
        }
    }

 

 

Hope this helps!

 


✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

0 Upvotes
1 Reply 1
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

[deals] Find associated company id

SOLVE

Hi @Rintegration,

 

When making the API call to the GET deal endpoint, you need to add an "associations" parameter and include the object type ID you want to get the associations for.

 

For example, if you would like to get the associated Company ID of a specific deal, you would make this API call:

 

 

https://api.hubapi.com/crm/v3/objects/deals/{dealId}?associations=0-2

 

 

(0-2 corresponds to the Company object type)

 

Then in the response body, the associations would show up in this format:

 

 

"associations": {
        "companies": {
            "results": [
                {
                    "id": "1234567890",
                    "type": "deal_to_company"
                },
                {
                    "id": "1234567890",
                    "type": "deal_to_company_unlabeled"
                }
            ]
        }
    }

 

 

Hope this helps!

 


✔️ Did this post help answer your query? Help the community by marking it as a solution.

0 Upvotes