<?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 Guidance Needed: Associating Two Custom Objects via HubSpot API using Python in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Guidance-Needed-Associating-Two-Custom-Objects-via-HubSpot-API/m-p/819907#M65649</link>
    <description>&lt;P&gt;I am currently working on a project where I am utilizing two custom objects in HubSpot and need to associate them programmatically via the API. The objects are named 'Households' and 'Financial Accounts'. My goal is to associate a financial account to a household once the account is either created or updated. I've tried making a POST request to '&lt;A href="https://api.hubapi.com/crm/v3/objects/associations" target="_new"&gt;https://api.hubapi.com/crm/v3/objects/associations&lt;/A&gt;', but I'm encountering an error message that says 'Unable to infer object type from: associations'.&lt;/P&gt;&lt;P&gt;I believe I may need to use an 'ASSOCIATION_DEFINITION_ID' in my API request, but I'm not sure how to obtain this or if it's the correct approach. Can you please guide me on the right way to make associations between custom objects using the HubSpot API? Also, how do I get the 'ASSOCIATION_DEFINITION_ID' if it is required?&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jul 2023 09:06:50 GMT</pubDate>
    <dc:creator>Fahadwaseem</dc:creator>
    <dc:date>2023-07-14T09:06:50Z</dc:date>
    <item>
      <title>Guidance Needed: Associating Two Custom Objects via HubSpot API using Python</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Guidance-Needed-Associating-Two-Custom-Objects-via-HubSpot-API/m-p/819907#M65649</link>
      <description>&lt;P&gt;I am currently working on a project where I am utilizing two custom objects in HubSpot and need to associate them programmatically via the API. The objects are named 'Households' and 'Financial Accounts'. My goal is to associate a financial account to a household once the account is either created or updated. I've tried making a POST request to '&lt;A href="https://api.hubapi.com/crm/v3/objects/associations" target="_new"&gt;https://api.hubapi.com/crm/v3/objects/associations&lt;/A&gt;', but I'm encountering an error message that says 'Unable to infer object type from: associations'.&lt;/P&gt;&lt;P&gt;I believe I may need to use an 'ASSOCIATION_DEFINITION_ID' in my API request, but I'm not sure how to obtain this or if it's the correct approach. Can you please guide me on the right way to make associations between custom objects using the HubSpot API? Also, how do I get the 'ASSOCIATION_DEFINITION_ID' if it is required?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 09:06:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Guidance-Needed-Associating-Two-Custom-Objects-via-HubSpot-API/m-p/819907#M65649</guid>
      <dc:creator>Fahadwaseem</dc:creator>
      <dc:date>2023-07-14T09:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Guidance Needed: Associating Two Custom Objects via HubSpot API using Python</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Guidance-Needed-Associating-Two-Custom-Objects-via-HubSpot-API/m-p/820251#M65666</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/598944"&gt;@Fahadwaseem&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Welcome to our community! Thanks for the great question &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To clarify, you need to both create the association between two Custom Objects and then use those associations between records?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Meaning, you want to:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create the association definitions between Object_Cats and Object_Dogs? And vice versa? (these associations are unidirectional, meaning you'll need to create and use them for a specific association “direction”) —&amp;nbsp;Object_Cats &amp;gt;&amp;nbsp;Object_Dogs &lt;STRONG&gt;will be different&lt;/STRONG&gt; from&amp;nbsp;Object_Dogs &amp;gt;&amp;nbsp;Object_Cats&lt;/LI&gt;
&lt;LI&gt;Create associations for records between these objects? Like associating record Tuexdo Cat with record Yellow Labrador?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You can do both from the &lt;A href="https://developers.hubspot.com/docs/api/crm/associations" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Associations v4 page&lt;/STRONG&gt;&lt;/A&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://developers.hubspot.com/docs/api/crm/associations#:~:text=Create%20association%20types" target="_blank" rel="noopener"&gt;Create association types&lt;/A&gt; —&lt;SPAN&gt;&amp;nbsp;To create an association type through the API, make a&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;POST&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;request to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;/crm/v4/associations/{fromObjectType}/{toObjectType}/labels&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://developers.hubspot.com/docs/api/crm/associations#:~:text=unlabeled%20association%20type.-,Associate%20records,-You%20can%20create" target="_blank" rel="noopener"&gt;Associate records&lt;/A&gt; —&lt;SPAN&gt;&amp;nbsp;To set up an individual default association between two records, make a&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;PUT&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;request to&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;/crm/v4​/objects​/{fromObjectType}​/{fromObjectId}​/associations​/default​/{toObjectType}​/{toObjectId}&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You can retrieve the IDs at any time by making a request &lt;A href="https://developers.hubspot.com/docs/api/crm/associations#:~:text=Retrieve%20association%20types" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;GET /crm/v4/associations/{fromObjectType}/{toObjectType}/labels&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps get you moving forward! — Jaycee&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 22:11:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Guidance-Needed-Associating-Two-Custom-Objects-via-HubSpot-API/m-p/820251#M65666</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-07-14T22:11:18Z</dc:date>
    </item>
  </channel>
</rss>

