<?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 Betreff: Update contacts with python API - batch mode in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/704246#M57714</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/459279"&gt;@ioteo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to the Community!&lt;/P&gt;
&lt;P&gt;I wonder if&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133120"&gt;@MatthiasWeber&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/144301"&gt;@taran42&lt;/a&gt;&amp;nbsp;could help us out? Thank you!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":star:"&gt;⭐&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;BR /&gt;Mia, Community Team&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2022 10:17:08 GMT</pubDate>
    <dc:creator>MiaSrebrnjak</dc:creator>
    <dc:date>2022-10-11T10:17:08Z</dc:date>
    <item>
      <title>Update contacts with python API - batch mode</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/703571#M57660</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to use the python API to update a set of HS contacts. I am able to do this contact by contact (with a for loop), but I would like to do this in batch mode.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Reading the documentation, I see that the input properties have to be in this format:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;inputs=[{"id":"1","properties":{"company":"Biglytics","email":"&lt;/SPAN&gt;&lt;A href="mailto:bcooper@biglytics.net" target="_blank" rel="noopener"&gt;bcooper@biglytics.net&lt;/A&gt;&lt;SPAN&gt;","firstname":"Bryan","lastname":"Cooper","phone":"&lt;/SPAN&gt;&lt;A href="tel:8779290687" target="_blank" rel="noopener"&gt;(877) 929-0687&lt;/A&gt;&lt;SPAN&gt;","website":"&lt;/SPAN&gt;&lt;A href="http://biglytics.net/" target="_blank" rel="noopener"&gt;biglytics.net&lt;/A&gt;&lt;SPAN&gt;"}}]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and I am wondering if there is a simple way to convert a python dictionary or list to this format? I've done something similar with the SimplePublicObjectInput, with something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SimplePublicObjectInput(properties=properties_ccontacts[0])&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and this creates the formatting needed for the "simple" (not batch) API to work. But I haven't found in the documentation something similar for the batch api.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Iván.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 07:46:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/703571#M57660</guid>
      <dc:creator>ioteo</dc:creator>
      <dc:date>2022-10-08T07:46:46Z</dc:date>
    </item>
    <item>
      <title>Betreff: Update contacts with python API - batch mode</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/704246#M57714</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/459279"&gt;@ioteo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to the Community!&lt;/P&gt;
&lt;P&gt;I wonder if&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133120"&gt;@MatthiasWeber&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/144301"&gt;@taran42&lt;/a&gt;&amp;nbsp;could help us out? Thank you!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":star:"&gt;⭐&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;BR /&gt;Mia, Community Team&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 10:17:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/704246#M57714</guid>
      <dc:creator>MiaSrebrnjak</dc:creator>
      <dc:date>2022-10-11T10:17:08Z</dc:date>
    </item>
    <item>
      <title>Betreff: Update contacts with python API - batch mode</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/704255#M57717</link>
      <description>&lt;P&gt;i'm sorry. No knowledge in python. Sorry.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 10:39:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/704255#M57717</guid>
      <dc:creator>MatthiasWeber</dc:creator>
      <dc:date>2022-10-11T10:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Update contacts with python API - batch mode</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/707496#M57956</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;Hey&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;not quite sure if I follow you, but there is a class called&amp;nbsp;&lt;I&gt;BatchInputSimplePublicObjectBatchInput&amp;nbsp;&lt;/I&gt;that you could use in this scenario, where you can pull in a list of dictionaries into the input. It looks something like this:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;updateInputs = BatchInputSimplePublicObjectBatchInput( inputs=[ { "id": "1", "properties": { "company": "Biglytics", "email": "bcooper@biglytics.net", "firstname": "Bryan", "lastname": "Cooper", "phone": "(877) 929-0687", "website": "biglytics.net", }, }, { "id": "1", "properties": { "company": "Biglytics", "email": "bcooper@biglytics.net", "firstname": "Bryan", "lastname": "Cooper", "phone": "(877) 929-0687", "website": "biglytics.net", }, }, ] )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;You can then use that as an argument of the request in&amp;nbsp;&lt;I&gt;batch_input_simple_public_object_batch_input &lt;/I&gt;like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;updateContacts = hubspot.crm.contacts.batch_api.update( batch_input_simple_public_object_batch_input=updateInputs )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;Sorry about the formatting, but the system won't let me post with code blocks and proper highlighting.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;Maybe you knew this already, so please give some more detail regarding your original question.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;But if you found this post helpful, consider helping others in the community to find answers faster by marking this as a solution. I'd really appreciate it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;Cheers,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=""&gt;&lt;SPAN class=""&gt;Chriso&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 07:46:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/707496#M57956</guid>
      <dc:creator>ChrisoKlepke</dc:creator>
      <dc:date>2022-10-19T07:46:44Z</dc:date>
    </item>
    <item>
      <title>Betreff: Update contacts with python API - batch mode</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/707500#M57958</link>
      <description>&lt;P&gt;No worries Matthias, thank you for letting me know!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 07:55:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/707500#M57958</guid>
      <dc:creator>MiaSrebrnjak</dc:creator>
      <dc:date>2022-10-19T07:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Update contacts with python API - batch mode</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/707501#M57959</link>
      <description>&lt;P&gt;Thank you Chriso! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 07:55:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-contacts-with-python-API-batch-mode/m-p/707501#M57959</guid>
      <dc:creator>MiaSrebrnjak</dc:creator>
      <dc:date>2022-10-19T07:55:56Z</dc:date>
    </item>
  </channel>
</rss>

