APIs & Integrations

Rintegration
メンバー

[deals] Find associated company id

解決

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 いいね!
1件の承認済みベストアンサー
evaldas
解決策
キーアドバイザー | Platinum Partner
キーアドバイザー | Platinum Partner

[deals] Find associated company id

解決

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 いいね!
1件の返信
evaldas
解決策
キーアドバイザー | Platinum Partner
キーアドバイザー | Platinum Partner

[deals] Find associated company id

解決

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 いいね!