<?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: Multiple associations through API in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Multiple-associations-through-API/m-p/540038#M49368</link>
    <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/262474"&gt;@GrantCarlile&lt;/a&gt; !&lt;/P&gt;
&lt;P&gt;Was that directed at me or &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/206717"&gt;@HBrandao&lt;/a&gt; ?&lt;/P&gt;</description>
    <pubDate>Fri, 10 Dec 2021 01:33:49 GMT</pubDate>
    <dc:creator>dennisedson</dc:creator>
    <dc:date>2021-12-10T01:33:49Z</dc:date>
    <item>
      <title>Multiple associations through API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Multiple-associations-through-API/m-p/505619#M47435</link>
      <description>&lt;P&gt;I am currently on the beta for the flexible associations and I am struggling on how can I associate multiple companies to the same contact through the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As of now, I can perform the associations with no issues on the UI. However, when I try to replicate the same issue through the API, I am reaching a dead-end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import hubspot
from hubspot.crm.associations import BatchInputPublicAssociation, ApiException
client = hubspot.Client.create(api_key='api_key')

payload = [{
"from":{"id":"592476"},
"to":[
{"id":"4840447981","type":"contact_to_company"},
{"id":"4840447986","type":"contact_to_company_unlabeled"},
{"id":"4840448191","type":"contact_to_company_unlabeled"},
{"id":"4840448194","type":"contact_to_company_unlabeled"},
{"id":"4840448206","type":"contact_to_company_unlabeled"},
{"id":"4840448220","type":"contact_to_company_unlabeled"},
{"id":"4840448442","type":"contact_to_company_unlabeled"}]}]

batch_input_public_association = BatchInputPublicAssociation(inputs=payload)
try:
api_response = client.crm.associations.batch_api.create(from_object_type="contact", to_object_type="company", batch_input_public_association=batch_input_public_association)
print(api_response)
except ApiException as e:
print("Exception when calling batch_api-&amp;gt;create: %s\n" % e)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently getting this error:&lt;/P&gt;&lt;PRE&gt;message":"Invalid input JSON on line 1, column 46: Cannot deserialize instance of `com.hubspot.apiutils.core.models.PublicObjectId$Json` out of START_ARRAY token","correlationId":"fbc3fe63-c3be-4f94-8bda-8826111b421f&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Oct 2021 13:56:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Multiple-associations-through-API/m-p/505619#M47435</guid>
      <dc:creator>HBrandao</dc:creator>
      <dc:date>2021-10-05T13:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple associations through API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Multiple-associations-through-API/m-p/505846#M47449</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/206717"&gt;@HBrandao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you had a chance to check out the &lt;A href="https://developers.hubspot.com/docs/api/crm/associations/v4" target="_blank" rel="noopener"&gt;docs&lt;/A&gt; for the new endpoints?&amp;nbsp;&amp;nbsp; Was just made available.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 17:59:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Multiple-associations-through-API/m-p/505846#M47449</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-10-05T17:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple associations through API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Multiple-associations-through-API/m-p/539996#M49367</link>
      <description>&lt;P&gt;How's it going? What's the status?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 23:17:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Multiple-associations-through-API/m-p/539996#M49367</guid>
      <dc:creator>GrantCarlile</dc:creator>
      <dc:date>2021-12-09T23:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple associations through API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Multiple-associations-through-API/m-p/540038#M49368</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/262474"&gt;@GrantCarlile&lt;/a&gt; !&lt;/P&gt;
&lt;P&gt;Was that directed at me or &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/206717"&gt;@HBrandao&lt;/a&gt; ?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 01:33:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Multiple-associations-through-API/m-p/540038#M49368</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-12-10T01:33:49Z</dc:date>
    </item>
  </channel>
</rss>

