<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get deals based on company id in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Get-deals-based-on-company-id/m-p/841140#M66895</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/622591"&gt;@newera&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CRM records are associated to one another by a special type of object known as an "Association" object. There is even a &lt;A href="https://developers.hubspot.com/docs/api/analytics/events" target="_blank" rel="noopener"&gt;dedicated suite of endpoints&lt;/A&gt; to interact with this object type (create, read, update and delete associations).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When using the &lt;A href="https://developers.hubspot.com/docs/api/crm/companies" target="_blank" rel="noopener"&gt;CRM APIs&lt;/A&gt; you can include "associations" parameter in your request and specify the name of the associated objects you wish to retrieve. For instance the request below will retrieve all of the companies and any IDs of associated deals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GET https://api.hubapi.com/crm/v3/objects/companies?associations=deals
RESPONSE
{
    "results": [
        {
            "id": "8139119856",
            "properties": {
                "createdate": "2023-07-26T12:30:48.856Z",
                "domain": "nintendo.com",
                "hs_lastmodifieddate": "2023-08-28T13:51:39.121Z",
                "hs_object_id": "8139119856",
                "name": "Nintendo"
            },
            "createdAt": "2023-07-26T12:30:48.856Z",
            "updatedAt": "2023-08-28T13:51:39.121Z",
            "archived": false,
            "associations": {
                "deals": {
                    "results": [
                        {
                            "id": "8330464724",
                            "type": "company_to_deal"
                        },
                        {
                            "id": "8330517224",
                            "type": "company_to_deal"
                        },
                        {
                            "id": "8511793392",
                            "type": "company_to_deal"
                        },
                        {
                            "id": "8330464724",
                            "type": "company_to_deal_unlabeled"
                        },
                        {
                            "id": "8330517224",
                            "type": "company_to_deal_unlabeled"
                        },
                        {
                            "id": "8511793392",
                            "type": "company_to_deal_unlabeled"
                        }
                    ]
                }
            }
        },
        {
            "id": "8109465573",
            "properties": {
                "createdate": "2023-07-20T13:25:52.999Z",
                "domain": "marvel.com",
                "hs_lastmodifieddate": "2023-08-21T03:30:57.721Z",
                "hs_object_id": "8109465573",
                "name": "Marvel"
            },
            "createdAt": "2023-07-20T13:25:52.999Z",
            "updatedAt": "2023-08-21T03:30:57.721Z",
            "archived": false
        }
    ],
    "paging": {
        "next": {
            "after": "8239956985",
            "link": "https://api.hubapi.com/crm/v3/objects/companies?associations=deals&amp;amp;after=8239956985"
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice in the above request there is an associations object containing "deals" with an array of results. You can then use the ID of each deal to retrieve specific pieces of information i.e the name, amount, stage etc...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 14:00:33 GMT</pubDate>
    <dc:creator>coldrickjack</dc:creator>
    <dc:date>2023-08-28T14:00:33Z</dc:date>
    <item>
      <title>Get deals based on company id</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Get-deals-based-on-company-id/m-p/841082#M66886</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm trying to match a deal with a company:&lt;/P&gt;&lt;P&gt;I've used this endpoint to get the companies&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://api.hubapi.com/crm/v3/objects/companies" target="_blank"&gt;https://api.hubapi.com/crm/v3/objects/companies&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;and then this endpoint go get deals&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://api.hubapi.com/crm/v3/objects/deals?properties=hubspot_owner_id,amount,closedate,createdate,dealname,dealstage,pipeline,hs_lastmodifieddate" target="_blank"&gt;https://api.hubapi.com/crm/v3/objects/deals?properties=hubspot_owner_id,amount,closedate,createdate,dealname,dealstage,pipeline,hs_lastmodifieddate&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;but there is no uid in deals to I can know that is belongs to a company.&lt;BR /&gt;&lt;BR /&gt;Or is there and easier way to get companies that include the deals or how should I link these together.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 28 Aug 2023 12:30:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Get-deals-based-on-company-id/m-p/841082#M66886</guid>
      <dc:creator>newera</dc:creator>
      <dc:date>2023-08-28T12:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get deals based on company id</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Get-deals-based-on-company-id/m-p/841140#M66895</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/622591"&gt;@newera&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CRM records are associated to one another by a special type of object known as an "Association" object. There is even a &lt;A href="https://developers.hubspot.com/docs/api/analytics/events" target="_blank" rel="noopener"&gt;dedicated suite of endpoints&lt;/A&gt; to interact with this object type (create, read, update and delete associations).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When using the &lt;A href="https://developers.hubspot.com/docs/api/crm/companies" target="_blank" rel="noopener"&gt;CRM APIs&lt;/A&gt; you can include "associations" parameter in your request and specify the name of the associated objects you wish to retrieve. For instance the request below will retrieve all of the companies and any IDs of associated deals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GET https://api.hubapi.com/crm/v3/objects/companies?associations=deals
RESPONSE
{
    "results": [
        {
            "id": "8139119856",
            "properties": {
                "createdate": "2023-07-26T12:30:48.856Z",
                "domain": "nintendo.com",
                "hs_lastmodifieddate": "2023-08-28T13:51:39.121Z",
                "hs_object_id": "8139119856",
                "name": "Nintendo"
            },
            "createdAt": "2023-07-26T12:30:48.856Z",
            "updatedAt": "2023-08-28T13:51:39.121Z",
            "archived": false,
            "associations": {
                "deals": {
                    "results": [
                        {
                            "id": "8330464724",
                            "type": "company_to_deal"
                        },
                        {
                            "id": "8330517224",
                            "type": "company_to_deal"
                        },
                        {
                            "id": "8511793392",
                            "type": "company_to_deal"
                        },
                        {
                            "id": "8330464724",
                            "type": "company_to_deal_unlabeled"
                        },
                        {
                            "id": "8330517224",
                            "type": "company_to_deal_unlabeled"
                        },
                        {
                            "id": "8511793392",
                            "type": "company_to_deal_unlabeled"
                        }
                    ]
                }
            }
        },
        {
            "id": "8109465573",
            "properties": {
                "createdate": "2023-07-20T13:25:52.999Z",
                "domain": "marvel.com",
                "hs_lastmodifieddate": "2023-08-21T03:30:57.721Z",
                "hs_object_id": "8109465573",
                "name": "Marvel"
            },
            "createdAt": "2023-07-20T13:25:52.999Z",
            "updatedAt": "2023-08-21T03:30:57.721Z",
            "archived": false
        }
    ],
    "paging": {
        "next": {
            "after": "8239956985",
            "link": "https://api.hubapi.com/crm/v3/objects/companies?associations=deals&amp;amp;after=8239956985"
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice in the above request there is an associations object containing "deals" with an array of results. You can then use the ID of each deal to retrieve specific pieces of information i.e the name, amount, stage etc...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 14:00:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Get-deals-based-on-company-id/m-p/841140#M66895</guid>
      <dc:creator>coldrickjack</dc:creator>
      <dc:date>2023-08-28T14:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get deals based on company id</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Get-deals-based-on-company-id/m-p/841949#M66964</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/426475"&gt;@coldrickjack&lt;/a&gt;&amp;nbsp;that worked&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 17:02:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Get-deals-based-on-company-id/m-p/841949#M66964</guid>
      <dc:creator>newera</dc:creator>
      <dc:date>2023-08-29T17:02:23Z</dc:date>
    </item>
  </channel>
</rss>

