<?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 Create bulk association between one contact to multiple companies in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/806157#M64799</link>
    <description>&lt;P&gt;Base on message from MaggieB here, we are now able to create association contact to multiple companies:&amp;nbsp;&lt;A href="https://community.hubspot.com/t5/HubSpot-Ideas/Associate-one-contact-to-multiple-companies/idi-p/19236" target="_blank" rel="noopener"&gt;https://community.hubspot.com/t5/HubSpot-Ideas/Associate-one-contact-to-multiple-companies/idi-p/19236&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this page, we also have associtation with primary company and non-primary company by UI&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/crm-setup/associate-records" target="_blank" rel="noopener"&gt;https://knowledge.hubspot.com/crm-setup/associate-records&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I tried to do that with API, it raise an exception 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;Conflicting one-to-one association: Association{fromObjectId=5657, toObjectId=7797520586, associationCategory=HUBSPOT_DEFINED, associationTypeId=1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I provide a screenshot from postman&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-06-12 at 18.21.01.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/92732i376B80D680F7E931/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-06-12 at 18.21.01.png" alt="Screenshot 2023-06-12 at 18.21.01.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Above example is when I tried to create associations from contact id&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;5657 to company id&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;7797566184 and&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;7797520586&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The association type I inputted is 1 (contact-to-company). Any missing steps that I did or invalid params that I've made? Thank you!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 12 Jun 2023 16:26:38 GMT</pubDate>
    <dc:creator>MNaufal</dc:creator>
    <dc:date>2023-06-12T16:26:38Z</dc:date>
    <item>
      <title>Create bulk association between one contact to multiple companies</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/806157#M64799</link>
      <description>&lt;P&gt;Base on message from MaggieB here, we are now able to create association contact to multiple companies:&amp;nbsp;&lt;A href="https://community.hubspot.com/t5/HubSpot-Ideas/Associate-one-contact-to-multiple-companies/idi-p/19236" target="_blank" rel="noopener"&gt;https://community.hubspot.com/t5/HubSpot-Ideas/Associate-one-contact-to-multiple-companies/idi-p/19236&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this page, we also have associtation with primary company and non-primary company by UI&amp;nbsp;&lt;A href="https://knowledge.hubspot.com/crm-setup/associate-records" target="_blank" rel="noopener"&gt;https://knowledge.hubspot.com/crm-setup/associate-records&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I tried to do that with API, it raise an exception 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;Conflicting one-to-one association: Association{fromObjectId=5657, toObjectId=7797520586, associationCategory=HUBSPOT_DEFINED, associationTypeId=1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I provide a screenshot from postman&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-06-12 at 18.21.01.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/92732i376B80D680F7E931/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-06-12 at 18.21.01.png" alt="Screenshot 2023-06-12 at 18.21.01.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Above example is when I tried to create associations from contact id&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;5657 to company id&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;7797566184 and&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;7797520586&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The association type I inputted is 1 (contact-to-company). Any missing steps that I did or invalid params that I've made? Thank you!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Jun 2023 16:26:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/806157#M64799</guid>
      <dc:creator>MNaufal</dc:creator>
      <dc:date>2023-06-12T16:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create bulk association between one contact to multiple companies</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/806771#M64834</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/577048"&gt;@MNaufal&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for the great question. You got yourself so close. Let's get the rest of the way there &lt;span class="lia-unicode-emoji" title=":ship:"&gt;🚢&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best first step when working with the &lt;A href="https://developers.hubspot.com/docs/api/crm/associations" target="_blank" rel="noopener"&gt;v4 Associations API&lt;/A&gt; is to double-check your labels and their IDs. If we make a request here —GET&amp;nbsp;&lt;SPAN&gt;/crm/v4/associations/{fromObjectType}/{toObjectType}/labels&amp;nbsp;&lt;/SPAN&gt;, we'll get the IDs and any labels, if applicable. In this case, we see that for the HubSpot defined associations, 1 = Primary. In my request, 279 (no label) was returned as the other HubSpot defined Contact to Company association.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
    "results": [
        {
            "category": "USER_DEFINED",
            "typeId": 27,
            "label": "Test 1"
        },
        {
            "category": "HUBSPOT_DEFINED",
            "typeId": 279,
            "label": null
        },
        {
            "category": "USER_DEFINED",
            "typeId": 31,
            "label": "Vendor"
        },
        {
            "category": "HUBSPOT_DEFINED",
            "typeId": 1,
            "label": "Primary"
        },
        {
            "category": "USER_DEFINED",
            "typeId": 29,
            "label": "Nacho guy"
        }
    ]
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Knowing this, I recreated your request using my test account —&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Contact (Mort) with no associated companies&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CleanShot 2023-06-13 at 10.24.33.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/92813i16196344ACDD4649/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CleanShot 2023-06-13 at 10.24.33.png" alt="CleanShot 2023-06-13 at 10.24.33.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;Request:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;curl --request POST \
  --url https://api.hubapi.com/crm/v4/associations/contact/company/batch/create \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'content-type: application/json' \
  --data '{
  "inputs": [
    {
      "from": {
        "id": "1601"
      },
      "to": {
        "id": "16053398365"
      },
      "types": [
        {
          "associationCategory": "HUBSPOT_DEFINED",
          "associationTypeId": 1
        }
      ]
    },
    {
      "from": {
        "id": "1601"
      },
      "to": {
        "id": "10202231613"
      },
      "types": [
        {
          "associationCategory": "HUBSPOT_DEFINED",
          "associationTypeId": 279
        }
      ]
    }
  ]
}'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Response:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;HTTP 201

{
  "status": "COMPLETE",
  "results": [
    {
      "fromObjectTypeId": "0-1",
      "fromObjectId": 1601,
      "toObjectTypeId": "0-2",
      "toObjectId": 10202231613,
      "labels": []
    },
    {
      "fromObjectTypeId": "0-1",
      "fromObjectId": 1601,
      "toObjectTypeId": "0-2",
      "toObjectId": 16053398365,
      "labels": [
        "Primary"
      ]
    }
  ],
  "startedAt": "2023-06-13T16:40:57.595Z",
  "completedAt": "2023-06-13T16:40:57.663Z"
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mort with Primary and an associated company&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CleanShot 2023-06-13 at 10.41.34.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/92812iABAB619FDD278F58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CleanShot 2023-06-13 at 10.41.34.png" alt="CleanShot 2023-06-13 at 10.41.34.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps get you moving forward! — Jaycee&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 17:01:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/806771#M64834</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-06-13T17:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Create bulk association between one contact to multiple companies</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/807130#M64873</link>
      <description>&lt;P&gt;Thank you! I tried it and it works. Do you know how do I get the list of it? because in this link I couldn't found the 279 code. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview" target="_blank"&gt;https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Jun 2023 09:21:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/807130#M64873</guid>
      <dc:creator>MNaufal</dc:creator>
      <dc:date>2023-06-14T09:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create bulk association between one contact to multiple companies</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/807342#M64885</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/577048"&gt;@MNaufal&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; I am glad to know that worked! There is not a matching list in this case. You'll need to make the request to the endpoint to get both the HubSpot and User-defined associations and IDs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the v1 version of these endpoints, the endpoints don't utilize custom associations, so it was possible to give a &lt;A href="https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview" target="_blank" rel="noopener"&gt;fixed list&lt;/A&gt;. Like what you linked to. But with the updated endpoints, they allow users to create and use custom associations, which can have IDs unique to a portal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This makes publishing an inclusive list impossible. This is based on my read of the documentation and not defined anywhere I can find.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Legacy endpoints — fixed associations, provides a list of all associations IDs.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Updated endpoints — allows for custom associations, doesn't provide a list of all IDs, does provide an endpoint to query the IDs, both default and custom.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whew, that probably more than you asked for &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt; And I hope it's helpful!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Jaycee&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 15:57:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/807342#M64885</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-06-14T15:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create bulk association between one contact to multiple companies</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/807343#M64886</link>
      <description>&lt;P&gt;I see, no other way then. thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 15:58:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-bulk-association-between-one-contact-to-multiple/m-p/807343#M64886</guid>
      <dc:creator>MNaufal</dc:creator>
      <dc:date>2023-06-14T15:58:37Z</dc:date>
    </item>
  </channel>
</rss>

