<?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: Using imports API to create objects and associate them with pre-existing objects in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Using-imports-API-to-create-objects-and-associate-them-with-pre/m-p/1092000#M79375</link>
    <description>&lt;P&gt;Hey, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/873222"&gt;@KElliott5&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for your question. I believe you are on the right path with the last question in your post. Because the target objects are not part of the current import operation, you'll need to break this up into two requests:&lt;/P&gt;
&lt;UL&gt;
 &lt;LI&gt;do the import without associations&amp;nbsp;&lt;/LI&gt;
 &lt;LI&gt;hit the Associations API to create the relationship with your pre-existing objects&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/53048"&gt;@evaldas&lt;/a&gt;&lt;/SPAN&gt; &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/632288"&gt;@MadisonMoniz&lt;/a&gt;&lt;/SPAN&gt; &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/673740"&gt;@Danielle_J&lt;/a&gt;&lt;/SPAN&gt;, do you have any additional feedback for &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/873222"&gt;@KElliott5&lt;/a&gt;&lt;/SPAN&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for taking a look! — Jaycee&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2025 17:20:45 GMT</pubDate>
    <dc:creator>Jaycee_Lewis</dc:creator>
    <dc:date>2025-01-09T17:20:45Z</dc:date>
    <item>
      <title>Using imports API to create objects and associate them with pre-existing objects</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Using-imports-API-to-create-objects-and-associate-them-with-pre/m-p/1091793#M79361</link>
      <description>&lt;P&gt;I am using the Import API to ingest some objects and for most use cases that is working fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In one of my use cases however I am importing objects which will have an association with a pre-existing object (i.e. not an object that is included within the import). The association definitions are set up already.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My assumption was that I could both import the objects and create the associations at the same time, by using the following in the mapping JSON for the relevant CSV column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"columnObjectTypeId": "2-137774576", "columnName": "brandid", "toColumnObjectTypeId": "2-137774399","columnType": "FLEXIBLE_ASSOCIATION_LABEL"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, that is returning the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Response: {"status":"error","message":"toColumnObjectTypeId 2-137774399 for FlexibleAssociationColumn column brandid does not match provided objectTypes in import: [2-137774576]","correlationId":"6fb4ddb9-94f0-448a-8591-ae5d0b7cad75","context":{"toColumnObjectTypeId":["ObjectTypeId{metaTypeId=2, innerId=137774399}"]},"category":"VALIDATION_ERROR"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am confident that the object type IDs are correct. My hypothesis therefore is that in order to create the association at the same time as the import, I would need to have both the objects involved in the association within the import.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Since that isn't possible in my instance, I should instead use the Associations API to create the association after the initial import. Is that correct? Or have I missed something?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 11:51:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Using-imports-API-to-create-objects-and-associate-them-with-pre/m-p/1091793#M79361</guid>
      <dc:creator>KElliott5</dc:creator>
      <dc:date>2025-01-09T11:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using imports API to create objects and associate them with pre-existing objects</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Using-imports-API-to-create-objects-and-associate-them-with-pre/m-p/1092000#M79375</link>
      <description>&lt;P&gt;Hey, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/873222"&gt;@KElliott5&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for your question. I believe you are on the right path with the last question in your post. Because the target objects are not part of the current import operation, you'll need to break this up into two requests:&lt;/P&gt;
&lt;UL&gt;
 &lt;LI&gt;do the import without associations&amp;nbsp;&lt;/LI&gt;
 &lt;LI&gt;hit the Associations API to create the relationship with your pre-existing objects&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/53048"&gt;@evaldas&lt;/a&gt;&lt;/SPAN&gt; &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/632288"&gt;@MadisonMoniz&lt;/a&gt;&lt;/SPAN&gt; &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/673740"&gt;@Danielle_J&lt;/a&gt;&lt;/SPAN&gt;, do you have any additional feedback for &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/873222"&gt;@KElliott5&lt;/a&gt;&lt;/SPAN&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for taking a look! — Jaycee&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 17:20:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Using-imports-API-to-create-objects-and-associate-them-with-pre/m-p/1092000#M79375</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2025-01-09T17:20:45Z</dc:date>
    </item>
  </channel>
</rss>

